deleteByQuery #
Deletes documents matching the provided search query.
This is a low level route intended to bypass Kuzzle actions on document deletion, notably:
- check document write limit
- trigger realtime notifications
Query Syntax #
HTTP #
URL: http://kuzzle:7512/<index>/<collection>/_bulk/_query[?refresh=wait_for]
Method: DELETE
Body:
{
"query": {
// ...
}
}
Other protocols #
{
"index": "<index>",
"collection": "<collection>",
"controller": "document",
"action": "deleteByQuery",
"refresh": "wait_for",
"body": {
"query": {
// ...
}
}
}
Arguments #
collection
: collection nameindex
: index name
Optional #
refresh
: if set towait_for
, Kuzzle will not respond until the deleted documents are removed from the search indexes
Body properties #
query
: documents matching this search query will be deleted. Uses the ElasticSearch Query DSL syntax.
Response #
Returns the number of deleted documents.
{
"status": 200,
"error": null,
"index": "<index>",
"collection": "<collection>",
"controller": "bulk",
"action": "deleteByQuery",
"requestId": "<unique request identifier>",
"result": {
"deleted": 42
}
}
Edit this page on Github (opens new window)