Delete a synonym rule Added in 8.10.0

DELETE /_synonyms/{set_id}/{rule_id}

Delete a synonym rule from a synonym set.

Path parameters

  • set_id string Required

    The ID of the synonym set to update.

  • rule_id string Required

    The ID of the synonym rule to delete.

Query parameters

  • refresh boolean

    If true, the request will refresh the analyzers with the deleted synonym rule and wait for the new synonyms to be available before returning. If false, analyzers will not be reloaded with the deleted synonym rule

Responses

DELETE /_synonyms/{set_id}/{rule_id}
curl \
 --request DELETE 'http://api.example.com/_synonyms/{set_id}/{rule_id}' \
 --header "Authorization: $API_KEY"
Response examples (200)
A successful response from `DELETE _synonyms/my-synonyms-set/test-1`. All analyzers using this synonyms set will be reloaded automatically to reflect the rule being deleted.
{
  "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"
        ]
      }
    ]
  }
}