Type to search.

Create or update a synonym set

  • PUT /_synonyms/{id}
Auth The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability Generally available since 8.10 This functionality is generally available and ready for production usage. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

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 synonym sets.

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.

Required privileges

Cluster privileges manage_search_synonyms

Path parameters

id string required

The ID of the synonyms set to be created or updated.

Request body

synonyms_set union oneOf required

The synonym rules definitions for the synonyms set.

object or object[]
id string

The identifier for the synonym rule. If you do not specify a synonym rule ID when you create a rule, an identifier is created automatically by Elasticsearch.

synonyms string required

The synonyms that conform the synonym rule in Solr format.

Responses

application/json
result enum required
Values: created updated deleted not_found noop
reload_analyzers_details object required
reload_details object[] required
index string required
reloaded_analyzers string[] required
reloaded_node_ids string[] required
_shards object required
failed number required

The number of shards the operation or search attempted to run on but failed.

successful number required

The number of shards the operation or search succeeded on.

total number required

The number of shards the operation or search will run on overall.

skipped number