From d26bcc18c1ec68caa24bbc50f9c9dc28f9b441ef Mon Sep 17 00:00:00 2001 From: Finn Lewis Date: Tue, 12 Mar 2024 11:58:31 +0000 Subject: [PATCH 1/3] Add title field to fulltext index by default. --- ...ch_api.index.localgov_directories_index_default.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/config/install/search_api.index.localgov_directories_index_default.yml b/config/install/search_api.index.localgov_directories_index_default.yml index f85be65..37e5967 100644 --- a/config/install/search_api.index.localgov_directories_index_default.yml +++ b/config/install/search_api.index.localgov_directories_index_default.yml @@ -25,6 +25,14 @@ field_settings: 'entity:node': localgov_directories_page: directory_index node: directory_index + title: + label: Title + datasource_id: 'entity:node' + property_path: title + type: text + dependencies: + module: + - node datasource_settings: 'entity:node': bundles: @@ -45,4 +53,4 @@ tracker_settings: options: index_directly: true cron_limit: 50 -server: NULL +server: NULL From e9d586fff8c227727221697daa725408acee1f7b Mon Sep 17 00:00:00 2001 From: Finn Lewis Date: Tue, 12 Mar 2024 15:50:05 +0000 Subject: [PATCH 2/3] Update default config for directory search index to include title field as fulltext and html filter with default tag boosting. --- ...dex.localgov_directories_index_default.yml | 123 +++++++++++++++++- ...dex.localgov_directories_index_default.yml | 79 ++++++++--- 2 files changed, 182 insertions(+), 20 deletions(-) diff --git a/config/install/search_api.index.localgov_directories_index_default.yml b/config/install/search_api.index.localgov_directories_index_default.yml index 37e5967..a49a84b 100644 --- a/config/install/search_api.index.localgov_directories_index_default.yml +++ b/config/install/search_api.index.localgov_directories_index_default.yml @@ -7,11 +7,11 @@ dependencies: - field.storage.node.localgov_directory_title_sort - core.entity_view_mode.node.directory_index module: - - search_api - node + - search_api id: localgov_directories_index_default name: Directories -description: '' +description: 'Default search index for LocalGov Directories channel.' read_only: false field_settings: rendered_item: @@ -44,13 +44,130 @@ datasource_settings: processor_settings: add_url: { } aggregated_field: { } + custom_value: { } entity_status: { } + entity_type: { } + highlight: + weights: + postprocess_query: 0 + prefix: '' + suffix: '' + excerpt: true + excerpt_always: false + excerpt_length: 256 + exclude_fields: { } + highlight: always + highlight_partial: false + html_filter: + weights: + preprocess_index: -15 + preprocess_query: -15 + all_fields: false + fields: + - rendered_item + - title + title: true + alt: true + tags: + b: 2 + h1: 5 + h2: 3 + h3: 2 + strong: 2 + ignorecase: + weights: + preprocess_index: -20 + preprocess_query: -20 + all_fields: true + fields: + - localgov_directory_channels + - localgov_directory_title_sort + - rendered_item + - title language_with_fallback: { } rendered_item: { } + stemmer: + weights: + preprocess_index: 0 + preprocess_query: 0 + all_fields: true + fields: + - rendered_item + - title + exceptions: + mexican: mexic + texan: texa + stopwords: + weights: + preprocess_index: -5 + preprocess_query: -2 + all_fields: true + fields: + - rendered_item + - title + stopwords: + - a + - an + - and + - are + - as + - at + - be + - but + - by + - for + - if + - in + - into + - is + - it + - 'no' + - not + - of + - 'on' + - or + - s + - such + - t + - that + - the + - their + - then + - there + - these + - they + - this + - to + - was + - will + - with + tokenizer: + weights: + preprocess_index: -6 + preprocess_query: -6 + all_fields: true + fields: + - rendered_item + - title + spaces: '' + ignored: ._- + overlap_cjk: 1 + minimum_word_size: '3' + transliteration: + weights: + preprocess_index: -20 + preprocess_query: -20 + all_fields: true + fields: + - localgov_directory_channels + - localgov_directory_title_sort + - rendered_item + - title tracker_settings: default: indexing_order: fifo options: - index_directly: true cron_limit: 50 + index_directly: true + track_changes_in_references: true server: NULL diff --git a/modules/localgov_directories_db/config/conditional/search_api.index.localgov_directories_index_default.yml b/modules/localgov_directories_db/config/conditional/search_api.index.localgov_directories_index_default.yml index 5ce585c..e4bddef 100644 --- a/modules/localgov_directories_db/config/conditional/search_api.index.localgov_directories_index_default.yml +++ b/modules/localgov_directories_db/config/conditional/search_api.index.localgov_directories_index_default.yml @@ -8,11 +8,11 @@ dependencies: - search_api.server.localgov_directories_default - core.entity_view_mode.node.directory_index module: - - search_api - node + - search_api id: localgov_directories_index_default name: Directories -description: '' +description: 'Default search index for LocalGov Directories channel, installed by LocalGov Directories Database.' read_only: false field_settings: localgov_directory_channels: @@ -42,6 +42,14 @@ field_settings: 'entity:node': localgov_directories_page: directory_index node: directory_index + title: + label: Title + datasource_id: 'entity:node' + property_path: title + type: text + dependencies: + module: + - node datasource_settings: 'entity:node': bundles: @@ -54,31 +62,67 @@ datasource_settings: processor_settings: add_url: { } aggregated_field: { } + custom_value: { } entity_status: { } - ignorecase: - all_fields: true + entity_type: { } + highlight: + weights: + postprocess_query: 0 + prefix: '' + suffix: '' + excerpt: true + excerpt_always: false + excerpt_length: 256 + exclude_fields: { } + highlight: always + highlight_partial: false + html_filter: + weights: + preprocess_index: -15 + preprocess_query: -15 + all_fields: false fields: - - localgov_directory_title_sort - rendered_item + - title + title: true + alt: true + tags: + b: 2 + h1: 5 + h2: 3 + h3: 2 + strong: 2 + ignorecase: weights: preprocess_index: -20 preprocess_query: -20 + all_fields: true + fields: + - localgov_directory_channels + - localgov_directory_title_sort + - rendered_item + - title language_with_fallback: { } rendered_item: { } stemmer: + weights: + preprocess_index: 0 + preprocess_query: 0 all_fields: true fields: - rendered_item + - title exceptions: mexican: mexic texan: texa - weights: - preprocess_index: 0 - preprocess_query: 0 stopwords: + weights: + preprocess_index: -5 + preprocess_query: -2 all_fields: true fields: - rendered_item + - title stopwords: - a - an @@ -115,27 +159,28 @@ processor_settings: - was - will - with - weights: - preprocess_index: -5 - preprocess_query: -2 tokenizer: + weights: + preprocess_index: -6 + preprocess_query: -6 all_fields: true fields: - rendered_item + - title spaces: '' + ignored: ._- overlap_cjk: 1 minimum_word_size: '3' - weights: - preprocess_index: -6 - preprocess_query: -6 transliteration: + weights: + preprocess_index: -20 + preprocess_query: -20 all_fields: true fields: + - localgov_directory_channels - localgov_directory_title_sort - rendered_item - weights: - preprocess_index: -20 - preprocess_query: -20 + - title tracker_settings: default: indexing_order: fifo From 92648b458b6e262b7ad62d65cb97c3f381ee8b40 Mon Sep 17 00:00:00 2001 From: Finn Lewis Date: Tue, 12 Mar 2024 15:53:03 +0000 Subject: [PATCH 3/3] Update title fulltext to boost 5, in line with H1 boost config in html filter. --- .../search_api.index.localgov_directories_index_default.yml | 1 + .../search_api.index.localgov_directories_index_default.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/config/install/search_api.index.localgov_directories_index_default.yml b/config/install/search_api.index.localgov_directories_index_default.yml index a49a84b..7d64f9f 100644 --- a/config/install/search_api.index.localgov_directories_index_default.yml +++ b/config/install/search_api.index.localgov_directories_index_default.yml @@ -29,6 +29,7 @@ field_settings: label: Title datasource_id: 'entity:node' property_path: title + boost: 5.0 type: text dependencies: module: diff --git a/modules/localgov_directories_db/config/conditional/search_api.index.localgov_directories_index_default.yml b/modules/localgov_directories_db/config/conditional/search_api.index.localgov_directories_index_default.yml index e4bddef..478b0e9 100644 --- a/modules/localgov_directories_db/config/conditional/search_api.index.localgov_directories_index_default.yml +++ b/modules/localgov_directories_db/config/conditional/search_api.index.localgov_directories_index_default.yml @@ -46,6 +46,7 @@ field_settings: label: Title datasource_id: 'entity:node' property_path: title + boost: 5.0 type: text dependencies: module: