delete_by_query
Remove specific documents from an Elasticsearch index by defining a query, managing conflicts, and controlling refresh behavior.
Instructions
Delete documents in an Elasticsearch index based on a query
Input Schema
Name | Required | Description | Default |
---|---|---|---|
conflicts | No | What to do when version conflicts occur during the deletion | |
index | Yes | Name of the Elasticsearch index to delete documents from | |
maxDocs | No | Limit the number of documents to delete | |
query | Yes | Elasticsearch query to select documents for deletion | |
refresh | No | Should the index be refreshed after the deletion (defaults to true) |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"conflicts": {
"description": "What to do when version conflicts occur during the deletion",
"enum": [
"abort",
"proceed"
],
"type": "string"
},
"index": {
"description": "Name of the Elasticsearch index to delete documents from",
"minLength": 1,
"type": "string"
},
"maxDocs": {
"description": "Limit the number of documents to delete",
"exclusiveMinimum": 0,
"type": "integer"
},
"query": {
"additionalProperties": {},
"description": "Elasticsearch query to select documents for deletion",
"type": "object"
},
"refresh": {
"default": true,
"description": "Should the index be refreshed after the deletion (defaults to true)",
"type": "boolean"
}
},
"required": [
"index",
"query"
],
"type": "object"
}