Search: countries named in the phrase filter by company country (Q6)

"pigment Italie" only matched "pigment": the country was neither a tag nor
in the AND query fields, and the model matched Italian-sounding names.
Country names and demonyms (FR/EN, 259 countries, CountryForms generated
from Drupal and Wikidata) are detected in the phrase, taken out of the
keywords and of the model phrase, and become a condition: manufacturer or
distributor country, or tag of the same name. Results: exact matches and
neighbours of the country first, then the same search without country.
Index: manufacturer_country and distributor_country (reference paths,
reindexed when a company changes). A country alone lists its records.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-30 17:07:43 +01:00
co-authored by Claude Opus 5.5
parent 9557b6bd0b
commit 2e93c5c0f8
6 changed files with 677 additions and 26 deletions
+34 -5
View File
@@ -11,6 +11,7 @@ dependencies:
- field.storage.node.field_short_description
- field.storage.node.field_tags
- field.storage.node.field_thesaurus
- field.storage.taxonomy_term.field_public_address
- field.storage.taxonomy_term.field_synonyms
- search_api.server.materio
module:
@@ -77,6 +78,17 @@ field_settings:
dependencies:
module:
- node
distributor_country:
label: 'Distributor » Country'
datasource_id: 'entity:node'
property_path: 'field_distributor:entity:field_public_address:country_code'
type: string
dependencies:
config:
- field.storage.node.field_distributor
- field.storage.taxonomy_term.field_public_address
module:
- taxonomy
field_country_name_computed:
label: 'Country Name'
datasource_id: 'entity:node'
@@ -111,6 +123,17 @@ field_settings:
dependencies:
config:
- field.storage.node.field_short_description
manufacturer_country:
label: 'Manufacturer » Country'
datasource_id: 'entity:node'
property_path: 'field_manufacturer:entity:field_public_address:country_code'
type: string
dependencies:
config:
- field.storage.node.field_manufacturer
- field.storage.taxonomy_term.field_public_address
module:
- taxonomy
name:
label: 'Manufacturer » Terme de taxonomie » Nom'
datasource_id: 'entity:node'
@@ -418,9 +441,11 @@ processor_settings:
preprocess_query: -20
all_fields: false
aggregated_field: { }
auto_aggregated_fulltext_field: { }
content_access:
weights:
preprocess_query: -50
custom_value: { }
double_quote_workaround:
weights:
postprocess_query: 0
@@ -443,16 +468,19 @@ processor_settings:
- uuid
replacement: '|9999999998|'
entity_status: { }
entity_type: { }
html_filter:
weights:
preprocess_index: -15
preprocess_query: -49
all_fields: true
fields:
- distributor_country
- field_country_name_computed
- field_famille
- field_reference
- field_short_description
- manufacturer_country
- name
- name_1
- processed
@@ -478,11 +506,11 @@ processor_settings:
title: true
alt: true
tags:
b: 2
h1: 5
h2: 3
h3: 2
strong: 2
b: 2.0
h1: 5.0
h2: 3.0
h3: 2.0
strong: 2.0
language_with_fallback: { }
rendered_item: { }
solr_date_range:
@@ -493,6 +521,7 @@ tracker_settings:
indexing_order: fifo
options:
cron_limit: 50
delete_on_fail: true
index_directly: true
track_changes_in_references: true
server: materio