Create or update a synonym set Generally available; Added in 8.10.0
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.
For practical examples of how to create or update a synonyms set, refer to the External documentation.
Required authorization
- Cluster privileges:
manage_search_synonyms
PUT /_synonyms/{id}
Console
PUT _synonyms/my-synonyms-set
resp = client.synonyms.put_synonym( id="my-synonyms-set", )
const response = await client.synonyms.putSynonym({ id: "my-synonyms-set", });
response = client.synonyms.put_synonym( id: "my-synonyms-set" )
$resp = $client->synonyms()->putSynonym([ "id" => "my-synonyms-set", ]);
curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_synonyms/my-synonyms-set"