Create or update a synonym set
- PUT /_synonyms/{id}
Synonym sets are limited to a maximum of 100,000 synonym rules per set by default.
This limit is configurable using the synonyms.max_synonym_rules cluster setting.
When an existing synonyms set is updated, the search analyzers that use the synonyms set are reloaded automatically for all indices. This is equivalent to invoking the reload search analyzers API for all indices that use the synonyms set.
For practical examples of how to create or update a synonyms set, refer to the External documentation.
- Cluster privileges:
manage_search_synonyms
Path Parameters
-
idstring Idrequired -
The ID of the synonyms set to be created or updated.
Query Parameters
-
refreshboolean · default: true If
true, the request will refresh the analyzers with the new synonyms set and wait for the new synonyms to be available before returning. Iffalse, analyzers will not be reloaded with the new synonym set-
appendboolean · default: false If
true, the provided synonym rules are appended to the existing set, with matching IDs overwriting existing rules. Iffalse, the entire synonyms set is replaced with the new synonym rules definitions.
Request
-
synonyms_setoneOfrequired -
The synonym rules definitions for the synonyms set.
Response
-
reload_analyzers_detailsReloadResult -
Updating a synonyms set can reload the associated analyzers in case refresh is set to true. This information is the analyzers reloading result.
-
reload_detailsReloadDetailsrequired -
indexstringrequired -
reloaded_analyzersstringrequired -
reloaded_node_idsstringrequired -
_shardsShardStatisticsrequired -
failednumber uintrequired -
The number of shards the operation or search attempted to run on but failed.
-
successfulnumber uintrequired -
The number of shards the operation or search succeeded on.
-
totalnumber uintrequired -
The number of shards the operation or search will run on overall.
-
failuresShardFailure -
indexstring IndexName -
nodestring -
reasonErrorCauserequired -
typestringrequired -
The type of error
-
reasonstringnullable -
A human-readable explanation of the error, in English.
-
stack_tracestring -
The server stack trace. Present only if the
error_trace=trueparameter was sent with the request. -
caused_byErrorCause -
root_causeErrorCause -
suppressedErrorCause -
shardnumber -
statusstring -
primaryboolean -
skippednumber uint