Other modules that subscribe to PrepareIndexMappingEvent may want to set the analyzer to something other than 'standard'. For example, the Elasticsearch Connector Autocomplete module creates an 'ngram_analyzer'.
The issue is, using the above module as an example, that the ngram_analyzer analyzer gets overwritten by this module, which breaks the functionality of the autocomplete module.
The long term solution of course would be for the Elasticsearch Connector module to allow setting an explicit analyzer/search_analyzer per field rather than allowing anyone to change them through an event handler. But for now, to allow these modules to play nicely together we should only set the analyzer to standard if it is not already set to something else.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3168832-preserve-existing-analyzer.patch | 1.37 KB | Patrick Ryan |
Comments
Comment #2
Patrick Ryan commentedHere's a patch that will preserve an existing analyzer if one is already set.
Comment #3
dealancer commentedThis patch works for me, at least it does not break anything. Code looks good too.
Comment #5
dealancer commented