Create or update a synonym rule Added in 8.10.0

PUT /_synonyms/{set_id}/{rule_id}

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

  • set_id string Required

    The ID of the synonym set.

  • rule_id string Required

    The ID of the synonym rule to be updated or created.

application/json

Body Required

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
PUT /_synonyms/{set_id}/{rule_id}
curl \
 --request PUT http://api.example.com/_synonyms/{set_id}/{rule_id} \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '{"synonyms":"string"}'