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 authorization
- Cluster privileges:
manage_search_synonyms
Query parameters
-
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
PUT
/_synonyms/{id}
Console
PUT _synonyms/my-synonyms-set
curl \
--request PUT 'http://api.example.com/_synonyms/{id}' \
--header "Content-Type: application/json" \
--data '"{\n \"synonyms_set\": [\n {\n \"id\": \"test-1\",\n \"synonyms\": \"hello, hi\"\n },\n {\n \"synonyms\": \"bye, goodbye\"\n },\n {\n \"id\": \"test-2\",\n \"synonyms\": \"test =\u003e check\"\n }\n ]\n}"'
Request example
An example body for a `PUT _synonyms/my-synonyms-set` request.
{
"synonyms_set": [
{
"id": "test-1",
"synonyms": "hello, hi"
},
{
"synonyms": "bye, goodbye"
},
{
"id": "test-2",
"synonyms": "test => check"
}
]
}