Get synonym ruleedit

Retrieves a synonym rule from a synonyms set.


GET _synonyms/<synonyms_set>/<synonym_rule>


Requires the manage_search_synonyms cluster privilege.

Path parametersedit

(Required, string) Synonyms set identifier to retrieve the synonym rule from.
(Required, string) Synonym rule identifier to retrieve.

Response codesedit

404 (Missing resources)
The synonyms_set identifier was not found, or the synonym rule specified by synonym_rule was not found in the synonyms set.


The following example retrieves an existing synonym rule called test-1 for the synonyms set my-synonyms-set:

response = client.synonyms.get_synonym_rule(
  set_id: 'my-synonyms-set',
  rule_id: 'test-1'
puts response
GET _synonyms/my-synonyms-set/test-1
  "id": "test-1",
  "synonyms": "hello, hi"