-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Updateability of search-time synonyms #29051
Comments
Pinging @elastic/es-search-aggs |
+1 Myself, I solved this by creating a custom plugin that allows for uploading new resources. Not ideal but it works. Would be great if this could be built in! (Actually for all query-time resources: stopwords, common grams, etc..) |
+1 @byronvoorbach how do you do it without reopening the index? I'm also using search-time synonyms and I don't see a possibility to programmatically reload/flush my custom analyzer within my plugin or am I wrong? |
@Tobsucht I have a custom implementation of the SynonymFilter, which allows me to update synonyms without closing/opening the index. :) |
@byronvoorbach I thought there might be a "cleaner" solution ... :) Did it the same way now and it works. For everybody who wants to implement this using the ResourceWatcherService, this might help: https://discuss.elastic.co/t/instance-of-resourcewatcherservice/130285 |
@Tobsucht yeah was hoping for that too.. Sadly, I couldn't use ResourceWatcherService because I had the requirement of posting a new version of synonyms to a new rest-endpoint in ES, instead of updating the local files on all nodes. Nice that you got it to work! |
@jpountz Is this something planned for the near future? :) |
It has been discussed, but not scheduled yet. |
@jpountz: Thanks for the update. I know you folks have your priorities, but this feature has been brought up many times before. You can clearly see that there's a real need for it - just search in Github for elasticsearch synonymmap and look how many repositories with ES plugins are there (most of them really poor quality though). Don't want to point fingers, but "your biggest competitor" seems to support this use case via Managed Resources (unless I'm misinterpreting it). I think it would be really cool if you could at least put it somewhere on your roadmap. Cheers! |
Currently token filter settings are treated as fixed once they are declared and used in an analyzer. This done to prevent changes in analyzers that are already used actively to index documents, since changed to the analysis chain would corrupt the index. However, it would be sage to allow updates to token filters at search time ("search_analyzer"). This change introduces a new property of token filters where they can now be declared to be "updatable". If one tokenfilter in an analyzer is updateable in this way, it itself inherits this property and we can reject these analyzers if they are tried to be used at index time. This change demonstrates this with the "synonym" token filter as a first example. Relates to elastic#29051
Currently token filter settings are treated as fixed once they are declared and used in an analyzer. This is done to prevent changes in analyzers that are already used actively to index documents, since changes to the analysis chain could corrupt the index. However, it would be safe to allow updates to token filters at search time ("search_analyzer"). This change introduces a new property of token filters that allows to mark them as only being usable at search or at index time. Any analyzer that uses these tokenfilters inherits that property and can be rejected if they are used in other contexts. This is a first step towards making specific token filters (e.g. synonym filter) updateable. Relates to #29051
Currently token filter settings are treated as fixed once they are declared and used in an analyzer. This is done to prevent changes in analyzers that are already used actively to index documents, since changes to the analysis chain could corrupt the index. However, it would be safe to allow updates to token filters at search time ("search_analyzer"). This change introduces a new property of token filters that allows to mark them as only being usable at search or at index time. Any analyzer that uses these tokenfilters inherits that property and can be rejected if they are used in other contexts. This is a first step towards making specific token filters (e.g. synonym filter) updateable. Relates to #29051
Currently changing resources (like dictionaries, synonym files etc...) of search time analyzers is only possible by closing an index, changing the underlying resource (e.g. synonym files) and then re-opening the index for the change to take effect. This PR adds a new API endpoint that allows triggering reloading of certain analysis resources (currently token filters) that will then pick up changes in underlying file resources. To achieve this we introduce a new type of custom analyzer (ReloadableCustomAnalyzer) that uses a ReuseStrategy that allows swapping out analysis components. Custom analyzers that contain filters that are markes as "updateable" will automatically choose this implementation. This PR also adds this capability to `synonym` token filters for use in search time analyzers. Relates to elastic#29051
Currently changing resources (like dictionaries, synonym files etc...) of search time analyzers is only possible by closing an index, changing the underlying resource (e.g. synonym files) and then re-opening the index for the change to take effect. This PR adds a new API endpoint that allows triggering reloading of certain analysis resources (currently token filters) that will then pick up changes in underlying file resources. To achieve this we introduce a new type of custom analyzer (ReloadableCustomAnalyzer) that uses a ReuseStrategy that allows swapping out analysis components. Custom analyzers that contain filters that are markes as "updateable" will automatically choose this implementation. This PR also adds this capability to `synonym` token filters for use in search time analyzers. Relates to elastic#29051
Currently changing resources (like dictionaries, synonym files etc...) of search time analyzers is only possible by closing an index, changing the underlying resource (e.g. synonym files) and then re-opening the index for the change to take effect. This PR adds a new API endpoint that allows triggering reloading of certain analysis resources (currently token filters) that will then pick up changes in underlying file resources. To achieve this we introduce a new type of custom analyzer (ReloadableCustomAnalyzer) that uses a ReuseStrategy that allows swapping out analysis components. Custom analyzers that contain filters that are markes as "updateable" will automatically choose this implementation. This PR also adds this capability to `synonym` token filters for use in search time analyzers. Relates to #29051
Currently changing resources (like dictionaries, synonym files etc...) of search time analyzers is only possible by closing an index, changing the underlying resource (e.g. synonym files) and then re-opening the index for the change to take effect. This PR adds a new API endpoint that allows triggering reloading of certain analysis resources (currently token filters) that will then pick up changes in underlying file resources. To achieve this we introduce a new type of custom analyzer (ReloadableCustomAnalyzer) that uses a ReuseStrategy that allows swapping out analysis components. Custom analyzers that contain filters that are markes as "updateable" will automatically choose this implementation. This PR also adds this capability to `synonym` token filters for use in search time analyzers. Relates to #29051
Currently changing resources (like dictionaries, synonym files etc...) of search time analyzers is only possible by closing an index, changing the underlying resource (e.g. synonym files) and then re-opening the index for the change to take effect. This PR adds a new API endpoint that allows triggering reloading of certain analysis resources (currently token filters) that will then pick up changes in underlying file resources. To achieve this we introduce a new type of custom analyzer (ReloadableCustomAnalyzer) that uses a ReuseStrategy that allows swapping out analysis components. Custom analyzers that contain filters that are markes as "updateable" will automatically choose this implementation. This PR also adds this capability to `synonym` token filters for use in search time analyzers. Relates to elastic#29051
Currently changing resources (like dictionaries, synonym files etc...) of search time analyzers is only possible by closing an index, changing the underlying resource (e.g. synonym files) and then re-opening the index for the change to take effect. This PR adds a new API endpoint that allows triggering reloading of certain analysis resources (currently token filters) that will then pick up changes in underlying file resources. To achieve this we introduce a new type of custom analyzer (ReloadableCustomAnalyzer) that uses a ReuseStrategy that allows swapping out analysis components. Custom analyzers that contain filters that are markes as "updateable" will automatically choose this implementation. This PR also adds this capability to `synonym` token filters for use in search time analyzers. Relates to #29051
+1 |
We need a way to update synonyms that:
The text was updated successfully, but these errors were encountered: