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

Allow reloading of search time analyzers #43313

Merged
merged 9 commits into from
Jun 27, 2019

Conversation

cbuescher
Copy link
Member

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

Christoph Büscher added 3 commits June 14, 2019 17:29
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
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

@cbuescher
Copy link
Member Author

@jpountz this PR merges the feature branch containing #42888 and accompanying documentation from #42891 into master. Those already got reviewed, but you mentioned you want to take another look at the whole branch.

Copy link
Contributor

@jpountz jpountz left a 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.

Christoph Büscher added 3 commits June 25, 2019 10:31
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.
@cbuescher
Copy link
Member Author

@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.

@cbuescher cbuescher force-pushed the reloadable-analyzers-feature branch from d1eedf9 to fca53c5 Compare June 25, 2019 17:09
@cbuescher
Copy link
Member Author

@elasticmachine run elasticsearch-ci/2

@cbuescher cbuescher changed the title Add Reloadability of search time analyzers Allow reloading of search time analyzers Jun 27, 2019
@cbuescher
Copy link
Member Author

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.

@cbuescher cbuescher merged commit 56ee1a5 into elastic:master Jun 27, 2019
cbuescher pushed a commit to cbuescher/elasticsearch that referenced this pull request Jun 27, 2019
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
cbuescher pushed a commit that referenced this pull request Jun 28, 2019
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
cbuescher pushed a commit to cbuescher/elasticsearch that referenced this pull request Jun 28, 2019
This change adds the new endpoint that allows reloading of search analyzers to
the high-level java rest client.

Relates to elastic#43313
Copy link
Contributor

@jpountz jpountz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

cbuescher pushed a commit that referenced this pull request Jul 3, 2019
This change adds the new endpoint that allows reloading of search analyzers to
the high-level java rest client.

Relates to #43313
cbuescher pushed a commit that referenced this pull request Jul 3, 2019
This change adds the new endpoint that allows reloading of search analyzers to
the high-level java rest client.

Relates to #43313
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants