Setup
- Solr version: 8.11
- Drupal Core version: 10.1.6
- Search API version:1.30
- Search API Solr version:4.3.1
- Configured Solr Connector:basic_auth
Greetings,
I am trying to use the solr_search_synonym module to allow synonyms management from Drupal. I tried to add the recommended configuration in two ways:
1. By directly editing the YAML configuration file for the field (i.e. search_api_solr.solr_field_type.text_en_7_0_0.yml)
2. By using the UI from/admin/config/search/search-api/server/solr/solr_field_type
Either way when I use the "Get config.zip" button (/admin/config/search/search-api/server/solr/solr_configset/config-zip) the resulted ZIP file is invalid. It no longer contains the text_en field inside the archive (i.e. text_en removed from schema_extra_types.xml and accents_en, stopwords_en, synonyms_en, protwords_en etc all are moved).
I am attaching here the modified search_api_solr.solr_field_type.text_en_7_0_0.yml file where basically:
a) I replaced solr.SynonymGraphFilterFactory with solr.ManagedSynonymGraphFilterFactory in query analyzer and
b) added solr.ManagedSynonymGraphFilterFactory and solr.FlattenGraphFilterFactory in index analizer as recommended here: https://solr.apache.org/guide/8_1/managed-resources.html#managing-synonyms
It resulted in something like this:
{
"name": "text_en",
...
"indexAnalyzer": {
...
"filters": [
...
{
"class": "solr.ManagedSynonymGraphFilterFactory",
"managed": "english"
},
{
"class": "solr.FlattenGraphFilterFactory"
}
]
},
"queryAnalyzer": {
"charFilters": [
{
"class": "solr.MappingCharFilterFactory",
"mapping": "accents_en.txt"
}
],
"tokenizer": {
"class": "solr.StandardTokenizerFactory"
},
"filters": [
{
"class": "solr.ManagedSynonymGraphFilterFactory",
"managed": "english"
},
...
]
}
}
I need to investigate more, but I suspect it has something to do with search_api_solr.field_type.schema.yml file where the "managed" attribute is incompletely defined because ManagedSynonymGraphFilterFactory / ManagedSynonymGraphFilterFactory::managed seem to be missing but even after adding still didn't worked ...
managed:
type: string
label: 'ManagedSynonymGraphFilter:: ManagedStopFilter::managed'
nullable: true