Get synonym rule
Get synonym rule
New API reference
For the most up-to-date API details, refer to Synonyms APIs.
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_set
identifier was not found, or the synonym rule specified by synonym_rule
was 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"
}
当前内容版权归 elasticsearch 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 elasticsearch .