Get synonym rule
Retrieves a synonym rule from a synonyms set.
Request
GET _synonyms/<synonyms_set>/<synonym_rule>
Prerequisites
Requires the manage_search_synonyms cluster privilege.
Path parameters
-
<synonyms_set> - (Required, string) Synonyms set identifier to retrieve the synonym rule from.
-
<synonym_rule> - (Required, string) Synonym rule identifier to retrieve.
Response codes
-
404(Missing resources) - The
synonyms_setidentifier was not found, or the synonym rule specified bysynonym_rulewas not found in the synonyms set.
Examples
The 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"
}
© 2023-2025 Elasticsearch
As of September 2024, Elasticsearch is available under a choice of three licenses: the Server Side Public License (SSPL), the Elastic License, or the AGPLv3 (OSI approved).
Elasticsearch and the Elasticsearch logo are trademarks of Elasticsearch B.V., registered in the U.S. and in other countries.
https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-synonym-rule.html