-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Add documentation about reloading search analyzers #42891
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
Merged
cbuescher
merged 13 commits into
elastic:reloadable-analyzers-feature
from
cbuescher:reloadable-analyzers-docs
Jun 17, 2019
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
5893d66
Add documentation about reloading search analyzers
8a3cc0a
Adding the experimental warning and two additional note sections
e65ae20
Include api doc in index page and fix links
dbab4ca
iter
c75e477
Merge branch 'reloadable-analyzers-feature' into reloadable-analyzers…
bbd02a1
Merge branch 'reloadable-analyzers-feature' into reloadable-analyzers…
elasticmachine 5c1699c
Add new endpoint rest-api-spec
e578689
iter
016aa32
iter
981f4c9
Merge branch 'reloadable-analyzers-feature' into reloadable-analyzers…
6ee5647
adding rest-api stability
459cb6c
Change order of parameters
c59cca7
Addressing comments
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| [[indices-reload-analyzers]] | ||
| == Reload Search Analyzers | ||
|
|
||
| experimental[] | ||
|
|
||
| Reloads search analyzers and its resources. | ||
|
|
||
| The `_reload_search_analyzers` API can be run on one or more indices and will | ||
| reload all search analyzers that contain components that were marked as | ||
| updateable when they were created, such as | ||
| <<analysis-synonym-tokenfilter,synonym token filters>>: | ||
|
|
||
| [source,js] | ||
| -------------------------------------------------- | ||
| PUT /test_index | ||
| { | ||
| "settings": { | ||
| "index" : { | ||
| "analysis" : { | ||
| "analyzer" : { | ||
| "my_synonyms" : { | ||
| "tokenizer" : "whitespace", | ||
| "filter" : ["synonym"] | ||
| } | ||
| }, | ||
| "filter" : { | ||
| "synonym" : { | ||
| "type" : "synonym", | ||
| "synonyms_path" : "analysis/synonym.txt", | ||
| "updateable" : true <1> | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "mappings": { | ||
| "properties": { | ||
| "text": { | ||
| "type": "text", | ||
| "analyzer" : "standard", | ||
| "search_analyzer": "my_synonyms" <2> | ||
| } | ||
| } | ||
| } | ||
| } | ||
| -------------------------------------------------- | ||
| // CONSOLE | ||
|
|
||
| <1> Mark the synonym filter as updateable. | ||
| <2> Synonym analyzer is usable as a search_analyzer. | ||
|
|
||
| Calling the `_reload_search_analyzers` endpoint will now trigger reloading of the | ||
| synonyms from the configured "synonym.txt" file. | ||
cbuescher marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| NOTE: Reloading will happen on every node the index has shards, so its important | ||
| to update the synonym file contents on every data node (even the ones that don't currently | ||
| hold shard copies; shards might be relocated there in the future) before calling | ||
| reload to ensure the new state of the file is reflected everywhere in the cluster. | ||
|
|
||
| [source,js] | ||
| -------------------------------------------------- | ||
| POST /my_index/_reload_search_analyzers | ||
| -------------------------------------------------- | ||
| // CONSOLE | ||
| // TEST[s/^/PUT my_index\n/] | ||
33 changes: 33 additions & 0 deletions
33
rest-api-spec/src/main/resources/rest-api-spec/api/indices.reload_search_analyzers.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| { | ||
| "indices.reload_search_analyzers": { | ||
| "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-reload-analyzers.html", | ||
| "stability": "experimental", | ||
| "methods": ["GET", "POST"], | ||
| "url": { | ||
| "paths": ["/{index}/_reload_search_analyzers"], | ||
| "parts": { | ||
| "index": { | ||
| "type": "list", | ||
| "description" : "A comma-separated list of index names to reload analyzers for" | ||
| } | ||
| }, | ||
| "params": { | ||
| "ignore_unavailable": { | ||
| "type" : "boolean", | ||
| "description" : "Whether specified concrete indices should be ignored when unavailable (missing or closed)" | ||
| }, | ||
| "allow_no_indices": { | ||
| "type" : "boolean", | ||
| "description" : "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" | ||
| }, | ||
| "expand_wildcards": { | ||
| "type" : "enum", | ||
| "options" : ["open","closed","none","all"], | ||
| "default" : "open", | ||
| "description" : "Whether to expand wildcard expression to concrete indices that are open, closed or both." | ||
| } | ||
| } | ||
| }, | ||
| "body": null | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.