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.

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • result string Required

      Values are created, updated, deleted, not_found, or noop.

    • reload_analyzers_details object Required
      Hide reload_analyzers_details attributes Show reload_analyzers_details attributes object
      • reload_details array[object] Required
        Hide reload_details attributes Show reload_details attributes object
        • index string Required
        • reloaded_analyzers array[string] Required
        • reloaded_node_ids array[string] Required
      • _shards object Required
        Hide _shards attributes Show _shards attributes object
        • failed number Required
        • successful number Required
        • total number Required
        • failures array[object]
          Hide failures attributes Show failures attributes object
          • index string
          • node string
          • reason object Required
            Hide reason attributes Show reason attributes object
            • type string Required

              The type of error

            • reason
            • stack_trace string

              The server stack trace. Present only if the error_trace=true parameter was sent with the request.

            • caused_by object
            • root_cause array[object]
            • suppressed array[object]
          • shard number Required
          • status string
        • skipped number
DELETE /_synonyms/{set_id}/{rule_id}
DELETE _synonyms/my-synonyms-set/test-1
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"
        ]
      }
    ]
  }
}