Delete synonym rule
Deletes an individual synonym rule from a synonyms set.
Request
DELETE _synonyms/<synonyms_set>/<synonym_rule>
Prerequisites
Requires the manage_search_synonyms cluster privilege.
Path parameters
-
<synonyms_set> - (Required, string) Synonyms set identifier to update.
-
<synonym_rule> - (Required, string) Synonym rule identifier to delete.
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 deletes an existing synonym rule called test-1 for the synonyms set my-synonyms-set:
resp = client.synonyms.delete_synonym_rule(
set_id="my-synonyms-set",
rule_id="test-1",
)
print(resp) response = client.synonyms.delete_synonym_rule( set_id: 'my-synonyms-set', rule_id: 'test-1' ) puts response
const response = await client.synonyms.deleteSynonymRule({
set_id: "my-synonyms-set",
rule_id: "test-1",
});
console.log(response); DELETE _synonyms/my-synonyms-set/test-1
{
"result": "deleted",
"reload_analyzers_details": {
"_shards": {
"total": 2,
"successful": 1,
"failed": 0
},
"reload_details": [
{
"index": "test-index",
"reloaded_analyzers": [
"my_search_analyzer"
],
"reloaded_node_ids": [
"1wYFZzq8Sxeu_Jvt9mlbkg"
]
}
]
}
} All analyzers using this synonyms set will be reloaded automatically to reflect the rule being deleted.
© 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/delete-synonym-rule.html