Skip to content

Commit

Permalink
Move mentions of updateable flag (#43536)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Christoph Büscher authored Jun 25, 2019
1 parent ff92ad6 commit ab24a04
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 50 deletions.
41 changes: 0 additions & 41 deletions docs/reference/analysis/tokenfilters/synonym-tokenfilter.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ appear before it in the chain.
Additional settings are:

* `expand` (defaults to `true`).
* `updateable` (defaults to false). If `true`, this marks the filter to be updateable using the
<<indices-reload-analyzers,analyzer reload API>>, but it will also restrict the filter to only be usable in
<<search-analyzer,search analyzers>>.
* `lenient` (defaults to `false`). If `true` ignores exceptions while parsing the synonym configuration. It is important
to note that only those synonym rules which cannot get parsed are ignored. For instance consider the following request:

Expand Down Expand Up @@ -186,41 +183,3 @@ error.
If you need to build analyzers that include both multi-token filters and synonym
filters, consider using the <<analysis-multiplexer-tokenfilter,multiplexer>> filter,
with the multi-token filters in one branch and the synonym filter in the other.

=== Updateability of search time synonyms

Synonym filters that are used in <<search-analyzer,search analyzers>> can be marked
as updateable using the `updateable` flag:

[source,js]
--------------------------------------------------
PUT /test_index
{
"settings": {
"index" : {
"analysis" : {
"analyzer" : {
"synonym" : {
"tokenizer" : "whitespace",
"filter" : ["synonym"]
}
},
"filter" : {
"synonym" : {
"type" : "synonym",
"synonyms_path" : "analysis/synonym.txt",
"updateable" : true
}
}
}
}
}
}
--------------------------------------------------
// CONSOLE

Using the <<indices-reload-analyzers,analyzer reload API>>, you can trigger reloading of the
synonym definition. The contents of the configured synonyms file will be reloaded and the
synonyms definition the filter uses will be updated.

NOTE: Trying to use the above analyzer as an index analyzer will result in an error.
3 changes: 0 additions & 3 deletions docs/reference/indices.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ index settings, aliases, mappings, and index templates.
* <<indices-refresh>>
* <<indices-flush>>
* <<indices-forcemerge>>
* <<indices-reload-analyzers>>

--

Expand Down Expand Up @@ -110,5 +109,3 @@ include::indices/refresh.asciidoc[]

include::indices/forcemerge.asciidoc[]

include::indices/reload-analyzers.asciidoc[]

Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
[role="xpack"]
[testenv="basic"]
[[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>>:
Synonym filters (both `synonym` and `synonym_graph`) can be declared as
updateable if they are only used in <<search-analyzer,search analyzers>>
with the `updateable` flag:

[source,js]
--------------------------------------------------
Expand Down Expand Up @@ -49,8 +50,14 @@ PUT /test_index
<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.
NOTE: Trying to use the above analyzer as an index analyzer will result in an error.

Using the <<indices-reload-analyzers,analyzer reload API>>, you can trigger reloading of the
synonym definition. The contents of the configured synonyms file will be reloaded and the
synonyms definition the filter uses will be updated.

The `_reload_search_analyzers` API can be run on one or more indices and will trigger
reloading of the synonyms from the configured file.

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
Expand Down
2 changes: 2 additions & 0 deletions docs/reference/rest-api/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ directly to configure and access {xpack} features.
* <<data-frame-apis,{dataframe-cap} APIs>>
* <<graph-explore-api,Graph Explore API>>
* <<freeze-index-api>>, <<unfreeze-index-api>>
* <<indices-reload-analyzers,Reload Search Analyzers API>>
* <<index-lifecycle-management-api,Index lifecycle management APIs>>
* <<licensing-apis,Licensing APIs>>
* <<ml-apis,Machine Learning APIs>>
Expand All @@ -35,4 +36,5 @@ include::{es-repo-dir}/rollup/rollup-api.asciidoc[]
include::{xes-repo-dir}/rest-api/security.asciidoc[]
include::{es-repo-dir}/indices/apis/unfreeze.asciidoc[]
include::{xes-repo-dir}/rest-api/watcher.asciidoc[]
include::{es-repo-dir}/indices/apis/reload-analyzers.asciidoc[]
include::defs.asciidoc[]

0 comments on commit ab24a04

Please sign in to comment.