Skip to content

Commit

Permalink
Merge branch 'SLB-480-global-search' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
chindris committed Nov 5, 2024
2 parents 03e730a + 3dbdd5f commit 97a4599
Show file tree
Hide file tree
Showing 3 changed files with 124 additions and 31 deletions.
141 changes: 118 additions & 23 deletions apps/cms/config/sync/search_api.index.global_search.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,43 @@ dependencies:
config:
- field.storage.media.field_media_image
- field.storage.media.field_media_video_file
- field.storage.media.field_media_oembed_video
- search_api.server.database
- core.entity_view_mode.config_pages.global_search
- core.entity_view_mode.media.global_search
- core.entity_view_mode.node.global_search
- core.entity_view_mode.user.global_search
module:
- path_alias
- menu_link_content
- silverback_campaign_urls
- user
- redirect
- search_api
- config_pages
- media
- node
- taxonomy
- webform
id: global_search
name: 'Global search'
description: ''
read_only: false
field_settings:
alias_destination:
label: 'URL alias'
datasource_id: 'entity:path_alias'
property_path: alias
type: text
dependencies:
module:
- path_alias
alias_source:
label: 'System path'
datasource_id: 'entity:path_alias'
property_path: path
type: text
dependencies:
module:
- path_alias
alt:
label: 'Image » Alternative text'
datasource_id: 'entity:media'
Expand All @@ -41,6 +58,22 @@ field_settings:
dependencies:
module:
- menu_link_content
campaign_url_destination:
label: Destination
datasource_id: 'entity:campaign_url'
property_path: campaign_url_destination
type: text
dependencies:
module:
- silverback_campaign_urls
campaign_url_source:
label: Source
datasource_id: 'entity:campaign_url'
property_path: campaign_url_source
type: text
dependencies:
module:
- silverback_campaign_urls
description:
label: 'Video file » Description'
datasource_id: 'entity:media'
Expand All @@ -57,14 +90,6 @@ field_settings:
dependencies:
module:
- menu_link_content
field_media_oembed_video:
label: 'Remote video URL'
datasource_id: 'entity:media'
property_path: field_media_oembed_video
type: text
dependencies:
config:
- field.storage.media.field_media_oembed_video
mail:
label: Email
datasource_id: 'entity:user'
Expand All @@ -81,6 +106,22 @@ field_settings:
dependencies:
module:
- menu_link_content
redirect_destination:
label: To
datasource_id: 'entity:redirect'
property_path: redirect_redirect
type: text
dependencies:
module:
- redirect
redirect_source:
label: From
datasource_id: 'entity:redirect'
property_path: redirect_source
type: text
dependencies:
module:
- redirect
rendered_item:
label: 'Rendered HTML output'
property_path: rendered_item
Expand All @@ -89,6 +130,8 @@ field_settings:
roles:
- editor
view_mode:
'entity:campaign_url':
campaign_url: ''
'entity:config_pages':
website_settings: global_search
'entity:media':
Expand All @@ -100,14 +143,14 @@ field_settings:
menu_link_content: ''
'entity:node':
page: global_search
'entity:path_alias':
path_alias: ''
'entity:redirect':
redirect: ''
'entity:taxonomy_term':
taxonomy_term: ''
'entity:user':
user: global_search
'entity:webform_submission':
contact: ''
inquiry: ''
styling: ''
title:
label: 'Image » Title'
datasource_id: 'entity:media'
Expand All @@ -125,6 +168,10 @@ field_settings:
module:
- menu_link_content
datasource_settings:
'entity:campaign_url':
bundles:
default: true
selected: { }
'entity:config_pages':
bundles:
default: true
Expand All @@ -150,6 +197,11 @@ datasource_settings:
languages:
default: true
selected: { }
'entity:path_alias': { }
'entity:redirect':
bundles:
default: true
selected: { }
'entity:taxonomy_term':
bundles:
default: true
Expand All @@ -161,10 +213,6 @@ datasource_settings:
languages:
default: true
selected: { }
'entity:webform_submission':
bundles:
default: true
selected: { }
processor_settings:
add_url: { }
aggregated_field: { }
Expand All @@ -187,13 +235,18 @@ processor_settings:
preprocess_query: -15
all_fields: true
fields:
- alias_destination
- alias_source
- alt
- bundle_menu_link
- campaign_url_destination
- campaign_url_source
- description
- description_menu_link
- field_media_oembed_video
- mail
- menu_name
- redirect_destination
- redirect_source
- rendered_item
- title
- title_menu_link
Expand All @@ -211,13 +264,18 @@ processor_settings:
preprocess_query: -20
all_fields: true
fields:
- alias_destination
- alias_source
- alt
- bundle_menu_link
- campaign_url_destination
- campaign_url_source
- description
- description_menu_link
- field_media_oembed_video
- mail
- menu_name
- redirect_destination
- redirect_source
- rendered_item
- title
- title_menu_link
Expand All @@ -229,13 +287,18 @@ processor_settings:
preprocess_query: -2
all_fields: true
fields:
- alias_destination
- alias_source
- alt
- bundle_menu_link
- campaign_url_destination
- campaign_url_source
- description
- description_menu_link
- field_media_oembed_video
- mail
- menu_name
- redirect_destination
- redirect_source
- rendered_item
- title
- title_menu_link
Expand Down Expand Up @@ -281,13 +344,18 @@ processor_settings:
preprocess_query: -6
all_fields: true
fields:
- alias_destination
- alias_source
- alt
- bundle_menu_link
- campaign_url_destination
- campaign_url_source
- description
- description_menu_link
- field_media_oembed_video
- mail
- menu_name
- redirect_destination
- redirect_source
- rendered_item
- title
- title_menu_link
Expand All @@ -301,16 +369,43 @@ processor_settings:
preprocess_query: -20
all_fields: true
fields:
- alias_destination
- alias_source
- alt
- bundle_menu_link
- campaign_url_destination
- campaign_url_source
- description
- description_menu_link
- field_media_oembed_video
- mail
- menu_name
- redirect_destination
- redirect_source
- rendered_item
- title
- title_menu_link
type_boost:
weights:
preprocess_index: 0
boosts:
'entity:campaign_url':
datasource_boost: 1.0
'entity:config_pages':
datasource_boost: 1.0
'entity:media':
datasource_boost: 2.0
'entity:menu_link_content':
datasource_boost: 1.0
'entity:node':
datasource_boost: 5.0
'entity:path_alias':
datasource_boost: 1.0
'entity:redirect':
datasource_boost: 1.0
'entity:taxonomy_term':
datasource_boost: 1.0
'entity:user':
datasource_boost: 1.0
tracker_settings:
default:
indexing_order: fifo
Expand Down
12 changes: 5 additions & 7 deletions apps/cms/config/sync/views.view.global_search.yml
Original file line number Diff line number Diff line change
Expand Up @@ -238,27 +238,25 @@ display:
- 'languages:language_interface'
- url
- url.query_args
- user
- 'user.node_grants:view'
- user.permissions
tags:
- 'config:search_api.index.global_search'
- 'search_api_list:global_search'
search:
id: search
display_title: Page
display_plugin: page
global_search_embed:
id: global_search_embed
display_title: 'Global search'
display_plugin: embed
position: 1
display_options:
display_description: ''
display_extenders: { }
path: admin/search
cache_metadata:
max-age: -1
contexts:
- 'languages:language_interface'
- url
- url.query_args
- user
- 'user.node_grants:view'
- user.permissions
tags:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function search(Request $request) {
$search = $request->query->get('search');
// More advanced example to include view results.
if ($view = Views::getView('global_search')) {
$view->setDisplay('search');
$view->setDisplay('global_search_embed');
if (!empty($search)) {
$view->setExposedInput(['search_api_fulltext' => $search]);
}
Expand Down

0 comments on commit 97a4599

Please sign in to comment.