83 lines
2.9 KiB
Plaintext
83 lines
2.9 KiB
Plaintext
[[synonyms-apis]]
|
|
== Synonyms APIs
|
|
|
|
++++
|
|
<titleabbrev>Synonyms APIs</titleabbrev>
|
|
++++
|
|
|
|
---
|
|
|
|
.New API reference
|
|
[sidebar]
|
|
--
|
|
For the most up-to-date API details, refer to {api-es}/group/endpoint-synonyms[Synonyms APIs].
|
|
--
|
|
|
|
The synonyms management API provides a convenient way to define and manage synonyms in an internal system index. Related synonyms can be grouped in a "synonyms set".
|
|
Create as many synonym sets as you need.
|
|
|
|
This provides an alternative to:
|
|
|
|
- Defining inline synonyms in an analyzer definition, which impacts mapping size and can lead to performance issues.
|
|
- Using synonyms files, which implies uploading and managing file consistency on all cluster nodes.
|
|
|
|
Synonyms sets can be used to configure <<analysis-synonym-graph-tokenfilter,synonym graph token filters>> and <<analysis-synonym-tokenfilter,synonym token filters>>.
|
|
These filters are applied as part of the <<analysis,analysis>> process by the <<search-analyzer,search analyzer>>.
|
|
|
|
NOTE: Synonyms sets are limited to a maximum of 10,000 synonym rules per set.
|
|
If you need to manage more synonym rules, you can create multiple synonyms sets.
|
|
|
|
WARNING: Synonyms sets must exist before they can be added to indices.
|
|
If an index is created referencing a nonexistent synonyms set, the index will remain in a partially created and inoperable state.
|
|
The only way to recover from this scenario is to ensure the synonyms set exists then either delete and re-create the index, or close and re-open the index.
|
|
|
|
[WARNING]
|
|
====
|
|
Invalid synonym rules can cause errors when applying analyzer changes.
|
|
For reloadable analyzers, this prevents reloading and applying changes.
|
|
You must correct errors in the synonym rules and reload the analyzer.
|
|
|
|
An index with invalid synonym rules cannot be reopened, making it inoperable when:
|
|
|
|
* A node containing the index starts
|
|
* The index is opened from a closed state
|
|
* A node restart occurs (which reopens the node assigned shards)
|
|
====
|
|
|
|
[discrete]
|
|
[[synonyms-sets-apis]]
|
|
=== Synonyms sets APIs
|
|
|
|
You can use these APIs to dynamically update synonyms sets used at search time.
|
|
Your search results will immediately reflect the synonyms set changes.
|
|
|
|
Use the following APIs to manage synonyms sets:
|
|
|
|
* <<put-synonyms-set>>
|
|
* <<get-synonyms-set>>
|
|
* <<list-synonyms-sets>>
|
|
* <<delete-synonyms-set>>
|
|
|
|
[discrete]
|
|
[[synonym-rules-apis]]
|
|
=== Synonym rules APIs
|
|
|
|
Synonyms sets are composed of synonym rules.
|
|
Each synonym rule defines a group of words that act as synonyms.
|
|
You can update individual synonym rules for a specific synonyms set instead of updating the complete synonyms set.
|
|
|
|
Use the following APIs to manage individual synonym rules in a synonyms set:
|
|
|
|
* <<put-synonym-rule>>
|
|
* <<get-synonym-rule>>
|
|
* <<delete-synonym-rule>>
|
|
|
|
include::put-synonyms-set.asciidoc[]
|
|
include::get-synonyms-set.asciidoc[]
|
|
include::list-synonyms-sets.asciidoc[]
|
|
include::delete-synonyms-set.asciidoc[]
|
|
include::put-synonym-rule.asciidoc[]
|
|
include::get-synonym-rule.asciidoc[]
|
|
include::delete-synonym-rule.asciidoc[]
|
|
|