Delete synonym rule

Delete synonym rule

New API reference

For the most up-to-date API details, refer to Synonyms APIs.

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_set identifier was not found, or the synonym rule specified by synonym_rule was 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:

  1. resp = client.synonyms.delete_synonym_rule(
  2. set_id="my-synonyms-set",
  3. rule_id="test-1",
  4. )
  5. print(resp)
  1. response = client.synonyms.delete_synonym_rule(
  2. set_id: 'my-synonyms-set',
  3. rule_id: 'test-1'
  4. )
  5. puts response
  1. const response = await client.synonyms.deleteSynonymRule({
  2. set_id: "my-synonyms-set",
  3. rule_id: "test-1",
  4. });
  5. console.log(response);
  1. DELETE _synonyms/my-synonyms-set/test-1
  1. {
  2. "result": "deleted",
  3. "reload_analyzers_details": {
  4. "_shards": {
  5. "total": 2,
  6. "successful": 1,
  7. "failed": 0
  8. },
  9. "reload_details": [
  10. {
  11. "index": "test-index",
  12. "reloaded_analyzers": [
  13. "my_search_analyzer"
  14. ],
  15. "reloaded_node_ids": [
  16. "1wYFZzq8Sxeu_Jvt9mlbkg"
  17. ]
  18. }
  19. ]
  20. }
  21. }

All analyzers using this synonyms set will be reloaded automatically to reflect the rule being deleted.