Get a synonym rule Generally available

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
    • synonyms string Required
GET /_synonyms/{set_id}/{rule_id}
GET _synonyms/my-synonyms-set/test-1 
resp = client.synonyms.get_synonym_rule( set_id="my-synonyms-set", rule_id="test-1", )
const response = await client.synonyms.getSynonymRule({ set_id: "my-synonyms-set", rule_id: "test-1", });
response = client.synonyms.get_synonym_rule( set_id: "my-synonyms-set", rule_id: "test-1" )
$resp = $client->synonyms()->getSynonymRule([ "set_id" => "my-synonyms-set", "rule_id" => "test-1", ]);
curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_synonyms/my-synonyms-set/test-1"
client.synonyms().getSynonymRule(g -> g .ruleId("test-1") .setId("my-synonyms-set") ); 
Response examples (200)
A successful response from `GET _synonyms/my-synonyms-set/test-1`.
{ "id": "test-1", "synonyms": "hello, hi" }