Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reload search analyzers does not work correctly with multiplexer filter (showstopper) #50554

Closed
zdeseb opened this issue Jan 2, 2020 · 2 comments · Fixed by #50662
Closed
Assignees
Labels
:Search/Analysis How text is split into tokens

Comments

@zdeseb
Copy link

zdeseb commented Jan 2, 2020

Elasticsearch version: Version: 7.5.1

Plugins installed: []

JVM version: 13.0.1

OS version: Windows 10 Pro

Description of the problem including expected versus actual behavior: When the synonym_graph filter is not used directly in an analyzer but is included in multiplexer filter (for example to allow combination with word_delimiter_graph), _reload_search_analyzers does not correctly find and reload appropriate analyzer.

Steps to reproduce:

  1. Create index
PUT /my_index
{
  "settings": {
    "index": {
      "analysis": {
        "analyzer": {
          "my_synonyms_only": {
            "tokenizer": "whitespace",
            "filter": [
              "synonym"
            ]
          },
          "my_synonyms": {
            "tokenizer": "whitespace",
            "filter": [
              "multiplexer"
            ]
          }
        },
        "filter": {
          "synonym": {
            "type": "synonym_graph",
            "synonyms_path": "analysis/synonyms.txt",
            "updateable": true
          },
          "delimiter": {
            "type": "word_delimiter_graph",
            "preserve_original": true
          },
          "multiplexer": {
            "type": "multiplexer",
            "filters": [
              "delimiter",
              "synonym"
            ]
          }
        }
      }
    }
  }
}
  1. Try to reload search analyzers
POST /my_index/_reload_search_analyzers
  1. Only the analyzer which uses synonym filter directly is updated. Analyzer with multiplexer is not.
  "reload_details" : [
    {
      "index" : "my_index",
      "reloaded_analyzers" : [
        "my_synonyms_only"
      ],
      "reloaded_node_ids" : [
        "ex70i64yRtar5gMPncOUTw"
      ]
    }
  ]

4. I would expect the my_synonyms analyzer to be reloaded also

@cbuescher cbuescher self-assigned this Jan 2, 2020
@cbuescher cbuescher added the :Search/Analysis How text is split into tokens label Jan 2, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (:Search/Analysis)

@cbuescher
Copy link
Member

Seems like the reloading action doesn't trigger the reload on the analyzer containing the multiplexer because as a filter in itself, that one isn't "updateable" (that is, it doesn't inherit the updateable property of the synonym filter it contains. I think we can try making the multiplexer search-time only if any of the filters it uses is search-time (i.e. updateable). I'll have a WIP as a proposal shortly, not however that there seem to be some general, documented restrictions on using synonym filters in multiplexers that are unrelated to this issue,

cbuescher pushed a commit that referenced this issue Jan 8, 2020
Currently, if an updateable synonym filter is included in a multiplexer filter, it is not reloaded via the 
_reload_search_analyzers because the multiplexer itself doesn't pass on the analysis mode of the 
filters it contains, so its not recognized as "updateable" in itself. Instead we can check and merge
the AnalysisMode settings of all filters in the multiplexer and use the resulting mode (e.g. search-time
only) for the multiplexer itself, thus making any synonym filters contained in it reloadable. 
This, of course, will also make the analyzers using the multiplexer be usable at search-time only.

Closes #50554
cbuescher pushed a commit that referenced this issue Jan 8, 2020
Currently, if an updateable synonym filter is included in a multiplexer filter,
it is not reloaded via the _reload_search_analyzers because the multiplexer
itself doesn't pass on the analysis mode of the filters it contains, so its not
recognized as "updateable" in itself. Instead we can check and merge the
AnalysisMode settings of all filters in the multiplexer and use the resulting
mode (e.g. search-time only) for the multiplexer itself, thus making any synonym
filters contained in it reloadable.  This, of course, will also make the
analyzers using the multiplexer be usable at search-time only.

Closes #50554
SivagurunathanV pushed a commit to SivagurunathanV/elasticsearch that referenced this issue Jan 23, 2020
Currently, if an updateable synonym filter is included in a multiplexer filter, it is not reloaded via the 
_reload_search_analyzers because the multiplexer itself doesn't pass on the analysis mode of the 
filters it contains, so its not recognized as "updateable" in itself. Instead we can check and merge
the AnalysisMode settings of all filters in the multiplexer and use the resulting mode (e.g. search-time
only) for the multiplexer itself, thus making any synonym filters contained in it reloadable. 
This, of course, will also make the analyzers using the multiplexer be usable at search-time only.

Closes elastic#50554
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Search/Analysis How text is split into tokens
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants