Get a synonym rule Generally available; Added in 8.10.0

GET /_synonyms/{set_id}/{rule_id}

Get a synonym rule from a synonym set.

Required authorization

  • Cluster privileges: manage_search_synonyms

Path parameters

  • set_id string Required

    The ID of the synonym set to retrieve the synonym rule from.

  • rule_id string Required

    The ID of the synonym rule to retrieve.

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • id string Required

      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.

GET /_synonyms/{set_id}/{rule_id}
curl \
 --request GET 'http://api.example.com/_synonyms/{set_id}/{rule_id}'
Response examples (200)
A successful response from `GET _synonyms/my-synonyms-set/test-1`.
{
  "id": "test-1",
  "synonyms": "hello, hi"
}