Schema export does not work when adding ManagedSynonymGraphFilterFactory filter

Created on 7 December 2023, 11 months ago
Updated 11 January 2024, 10 months ago

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
๐Ÿ› Bug report
Status

Closed: cannot reproduce

Version

4.3

Component

Solr Configuration Generator

Created by

๐Ÿ‡ท๐Ÿ‡ดRomania cristiroma

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @cristiroma
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany mkalkbrenner ๐Ÿ‡ฉ๐Ÿ‡ช

    Did you re-import the yml?

    In general I don't see the advantage of managed synonyms. You have to reload the core to apply the changes. And there're ressources l'รฎle protwords where no managed alternative exists.

    The approach to upload an entire config-set instead and to reload the core works for all ressources and has the advantage that you can easily keep the current state in a repository.

    Even if it doesn't explain the "bug", we decided to drop the support of managed fields, to have one Workflow that covers all.

  • Status changed to Closed: cannot reproduce 10 months ago
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany mkalkbrenner ๐Ÿ‡ฉ๐Ÿ‡ช

    no further feedback

Production build 0.71.5 2024