Reputation: 837
Below is a boolean search query. I want to delete all the document results matched by this query. How to do that?
I tried delete by query interface (new api is here)
CURL -XDELETE /index/doc/_query/routing=abc -d '{
"query": {
"bool": {
"must": [
{
"term": {
"_ua_family": "Firefox"
}
},
{
"range": {
"created_at": {
"gte": 1352147225,
"lte": 1352752025
}
}
}
],
"should": [],
"must_not": []
}
},
"sort": {
"created_at": "desc"
},
"facets": {
"_message": {
"histogram": {
"field": "created_at",
"interval": 3600
}
}
},
"from": 0,
"size": 10
}'
elasticsearch response contains
{
"_shards": {
"total": 1,
"successful": 0,
"failed": 1
}
}
Upvotes: 0
Views: 1099
Reputation: 837
Got it working, the query should be
{
"bool": {
"must": [{
"term": {
"_ua_family": "Firefox"
}
}, {
"range": {
"created_at": {
"gte": 1352147225,
"lte": 1352752025
}
}
}],
"should": [],
"must_not": []
}
}
Upvotes: 2