Create or update a synonym rule Added in 8.10.0
Create or update a synonym rule in a synonym set.
If any of the synonym rules included is invalid, the API returns an error.
When you update a synonym rule, all analyzers using the synonyms set will be reloaded automatically to reflect the new rule.
Path parameters
-
The ID of the synonym set.
-
The ID of the synonym rule to be updated or created.
PUT
/_synonyms/{set_id}/{rule_id}
curl \
--request PUT http://api.example.com/_synonyms/{set_id}/{rule_id} \
--header "Content-Type: application/json" \
--data '{"synonyms":"string"}'
Request examples
{
"synonyms": "string"
}
Response examples (200)
{
"result": "created",
"reload_analyzers_details": {
"reload_details": [
{
"index": "string",
"reloaded_analyzers": [
"string"
],
"reloaded_node_ids": [
"string"
]
}
],
"_shards": {
"failed": 42.0,
"successful": 42.0,
"total": 42.0,
"failures": [
{
"index": "string",
"node": "string",
"reason": {
"type": "string",
"reason": "string",
"stack_trace": "string",
"caused_by": {},
"root_cause": [
{}
],
"suppressed": [
{}
]
},
"shard": 42.0,
"status": "string"
}
],
"skipped": 42.0
}
}
}