This documentation contains work-in-progress information for future Elastic Stack and Cloud releases. Use the version selector to view supported release docs. It also contains some Elastic Cloud serverless information. Check out our serverless docs for more details.
Get synonym rule
editGet synonym rule
editRetrieves a synonym rule from a synonyms set.
Request
editGET _synonyms/<synonyms_set>/<synonym_rule>
Prerequisites
editRequires the manage_search_synonyms
cluster privilege.
Path parameters
edit-
<synonyms_set>
- (Required, string) Synonyms set identifier to retrieve the synonym rule from.
-
<synonym_rule>
- (Required, string) Synonym rule identifier to retrieve.
Response codes
edit-
404
(Missing resources) -
The
synonyms_set
identifier was not found, or the synonym rule specified bysynonym_rule
was not found in the synonyms set.
Examples
editThe following example retrieves an existing synonym rule called test-1
for the synonyms set my-synonyms-set
:
resp = client.synonyms.get_synonym_rule( set_id="my-synonyms-set", rule_id="test-1", ) print(resp)
response = client.synonyms.get_synonym_rule( set_id: 'my-synonyms-set', rule_id: 'test-1' ) puts response
const response = await client.synonyms.getSynonymRule({ set_id: "my-synonyms-set", rule_id: "test-1", }); console.log(response);
GET _synonyms/my-synonyms-set/test-1
{ "id": "test-1", "synonyms": "hello, hi" }