Skip to content

Commit

Permalink
[CIVIC-725] Added search page.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSkrypnyk committed Aug 1, 2023
1 parent 1c13f13 commit cd28c66
Show file tree
Hide file tree
Showing 17 changed files with 676 additions and 12 deletions.
3 changes: 2 additions & 1 deletion composer.d10.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
"php": ">=8.1",
"composer/installers": "^2",
"cweagans/composer-patches": "^1.7",
"drupal/core": "10.0",
"drupal/core-composer-scaffold": "^10",
"drupal/core-project-message": "^10",
"drupal/core-recommended": "^10",
"drupal/core": "10.0",
"drupal/search_api": "^1.29",
"drush/drush": "^11",
"oomphinc/composer-installers-extender": "^2.0",
"vlucas/phpdotenv": "^5.1",
Expand Down
74 changes: 73 additions & 1 deletion composer.d10.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "c0f0659f608b0fc64ba6fb78a176dafb",
"content-hash": "62f98b7513ee22f8064028d50280c3ae",
"packages": [
{
"name": "asm89/stack-cors",
Expand Down Expand Up @@ -2918,6 +2918,78 @@
"source": "https://git.drupalcode.org/project/redirect"
}
},
{
"name": "drupal/search_api",
"version": "1.29.0",
"source": {
"type": "git",
"url": "https://git.drupalcode.org/project/search_api.git",
"reference": "8.x-1.29"
},
"dist": {
"type": "zip",
"url": "https://ftp.drupal.org/files/projects/search_api-8.x-1.29.zip",
"reference": "8.x-1.29",
"shasum": "4663abbcfe5dfc159ee0886fc6c437e998fc0653"
},
"require": {
"drupal/core": "^9.3 || ^10.0"
},
"conflict": {
"drupal/search_api_solr": "2.* || 3.0 || 3.1"
},
"require-dev": {
"drupal/language_fallback_fix": "@dev",
"drupal/search_api_autocomplete": "@dev",
"drupal/search_api_db": "*"
},
"suggest": {
"drupal/facets": "Adds the ability to create faceted searches.",
"drupal/search_api_autocomplete": "Allows adding autocomplete suggestions to search fields.",
"drupal/search_api_solr": "Adds support for using Apache Solr as a backend."
},
"type": "drupal-module",
"extra": {
"drupal": {
"version": "8.x-1.29",
"datestamp": "1679910252",
"security-coverage": {
"status": "covered",
"message": "Covered by Drupal's security advisory policy"
}
},
"drush": {
"services": {
"drush.services.yml": "^9 || ^10"
}
}
},
"notification-url": "https://packages.drupal.org/8/downloads",
"license": [
"GPL-2.0-or-later"
],
"authors": [
{
"name": "Thomas Seidl",
"homepage": "https://www.drupal.org/u/drunken-monkey"
},
{
"name": "Nick Veenhof",
"homepage": "https://www.drupal.org/u/nick_vh"
},
{
"name": "See other contributors",
"homepage": "https://www.drupal.org/node/790418/committers"
}
],
"description": "Provides a generic framework for modules offering search capabilities.",
"homepage": "https://www.drupal.org/project/search_api",
"support": {
"source": "https://git.drupalcode.org/project/search_api",
"issues": "https://www.drupal.org/project/issues/search_api",
"irc": "irc://irc.freenode.org/drupal-search-api"
}
},
{
"name": "drupal/shield",
"version": "1.7.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ visibility:
request_path:
id: request_path
negate: true
pages: "/news-and-events\n\r*civictheme-no-sidebar*"
pages: "/search\n\r/news-and-events"
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ visibility:
request_path:
id: request_path
negate: true
pages: "/news-and-events"
pages: "/search\n\r/news-and-events"
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function civictheme_dev_post_update_update_side_navigation_block() {
$block->setVisibilityConfig('request_path', [
'id' => 'request_path',
'negate' => TRUE,
'pages' => "/news-and-events\n\r*civictheme-no-sidebar*",
'pages' => "/search\n\r/news-and-events\n\r*civictheme-no-sidebar*",
]);
$block->save();
}
Expand Down
5 changes: 5 additions & 0 deletions docroot/themes/contrib/civictheme/civictheme.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -631,4 +631,9 @@ config_devel:
- block.block.civictheme_signup
- linkit.linkit_profile.civictheme
- media.settings
- search_api.index.civictheme_content
- search_api.server.civictheme_database
- search_api.settings
- search_api_db.settings
- views.view.civictheme_search
#;> DEVELOPMENT
3 changes: 3 additions & 0 deletions docroot/themes/contrib/civictheme/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,8 @@
"drupal/redirect": "^1.8",
"drupal/simple_sitemap": "^4.1",
"drupal/webform": "^6.1"
},
"suggest": {
"drupal/search_api": "Provides a framework for easily creating searches on any entity known to Drupal, using any kind of search engine."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ plugin: 'menu_block:civictheme-primary-navigation'
settings:
id: 'menu_block:civictheme-primary-navigation'
label: 'Side Navigation'
label_display: ''
label_display: '0'
provider: menu_block
follow: false
follow_parent: child
Expand All @@ -28,4 +28,8 @@ settings:
expand_all_items: false
parent: 'civictheme-primary-navigation:'
suggestion: civictheme_primary_navigation
visibility: { }
visibility:
request_path:
id: request_path
negate: true
pages: /search
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
langcode: en
status: true
dependencies:
config:
- field.storage.node.field_c_n_summary
- field.storage.node.field_c_n_components
- field.storage.paragraph.field_c_p_content
- field.storage.paragraph.field_c_p_summary
- field.storage.paragraph.field_c_p_title
- search_api.server.civictheme_database
module:
- paragraphs
- node
- search_api
id: civictheme_content
name: Content
description: ''
read_only: false
field_settings:
field_c_n_summary:
label: Summary
datasource_id: 'entity:node'
property_path: field_c_n_summary
type: text
dependencies:
config:
- field.storage.node.field_c_n_summary
field_c_p_content:
label: 'Components » Paragraph » Content » Processed text'
datasource_id: 'entity:node'
property_path: 'field_c_n_components:entity:field_c_p_content:processed'
type: text
dependencies:
config:
- field.storage.node.field_c_n_components
- field.storage.paragraph.field_c_p_content
module:
- paragraphs
field_c_p_summary:
label: 'Components » Paragraph » Summary'
datasource_id: 'entity:node'
property_path: 'field_c_n_components:entity:field_c_p_summary'
type: text
dependencies:
config:
- field.storage.node.field_c_n_components
- field.storage.paragraph.field_c_p_summary
module:
- paragraphs
field_c_p_title:
label: 'Components » Paragraph » Title'
datasource_id: 'entity:node'
property_path: 'field_c_n_components:entity:field_c_p_title'
type: text
dependencies:
config:
- field.storage.node.field_c_n_components
- field.storage.paragraph.field_c_p_title
module:
- paragraphs
node_grants:
label: 'Node access information'
property_path: search_api_node_grants
type: string
indexed_locked: true
type_locked: true
hidden: true
status:
label: status
datasource_id: 'entity:node'
property_path: status
type: boolean
indexed_locked: true
type_locked: true
dependencies:
module:
- node
title:
label: Title
datasource_id: 'entity:node'
property_path: title
type: text
dependencies:
module:
- node
uid:
label: uid
datasource_id: 'entity:node'
property_path: uid
type: integer
indexed_locked: true
type_locked: true
dependencies:
module:
- node
datasource_settings:
'entity:node':
bundles:
default: true
selected:
- civictheme_alert
languages:
default: true
selected: { }
processor_settings:
add_url: { }
aggregated_field: { }
content_access:
weights:
preprocess_query: -30
entity_type: { }
ignorecase:
weights:
preprocess_index: -20
preprocess_query: -20
all_fields: false
fields:
- field_c_n_summary
- field_c_p_content
- field_c_p_summary
- field_c_p_title
- title
language_with_fallback: { }
rendered_item: { }
tracker_settings:
default:
indexing_order: fifo
options:
cron_limit: 50
index_directly: true
track_changes_in_references: true
server: civictheme_database
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
langcode: en
status: true
dependencies:
module:
- search_api_db
id: civictheme_database
name: Database
description: ''
backend: search_api_db
backend_config:
database: 'default:default'
min_chars: 1
matching: words
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
default_cron_limit: 50
cron_worker_runtime: 15
default_tracker: default
tracking_page_size: 100
boost_factors:
- !!float 0
- 0.1
- 0.2
- 0.3
- 0.5
- 0.6
- 0.7
- 0.8
- 0.9
- !!float 1
- 1.1
- 1.2
- 1.3
- 1.4
- 1.5
- !!float 2
- !!float 3
- !!float 5
- !!float 8
- !!float 13
- !!float 21
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
autocomplete_max_occurrences: 0.9
Loading

0 comments on commit cd28c66

Please sign in to comment.