-
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
Allow reloading of search time analyzers #43313
Allow reloading of search time analyzers #43313
Conversation
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
Pinging @elastic/es-search |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some minor comments but otherwise LGTM.
rest-api-spec/src/main/resources/rest-api-spec/api/indices.reload_search_analyzers.json
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/index/analysis/ReloadableCustomAnalyzer.java
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/index/analysis/ReloadableCustomAnalyzer.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/index/analysis/ReloadableCustomAnalyzer.java
Outdated
Show resolved
Hide resolved
The new "updateable" flag used with synonym and synonym_graph should be mentioned with the reload API endpoint which I also moved under the x-pack basic role with this change.
@jpountz I addressed your comments on this PR, also merged in a couple of other changes to the docs and moved the endpoint to xpack (both reviewed in #43536, #43559). Maybe you want to take another last look, the only thing I left like it was is allowing the GET/POST methods on the enpoint, but I'm happy to change that if you think its better. Let me know if I should change anything else, otherwise I'll try to get a green CI build before merging. |
d1eedf9
to
fca53c5
Compare
@elasticmachine run elasticsearch-ci/2 |
Talked to @jpountz and its okay to merge. If there are any changes that need to be done after the fact we can still get them in in a separate PR. |
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
This change adds the new endpoint that allows reloading of search analyzers to the high-level java rest client. Relates to elastic#43313
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
This change adds the new endpoint that allows reloading of search analyzers to the high-level java rest client. Relates to #43313
This change adds the new endpoint that allows reloading of search analyzers to the high-level java rest client. Relates to #43313
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