I am trying to delete a set of documents that do not match a field with a certain value by sending the following data through a DELETE request to "localhost:9200/products/phone":
{
"query": {
"filtered": {
"query": {
"match_all": []
},
"filter": {
"bool": {
"must": [],
"should": [],
"must_not": {
"term": {
"batch": 1433585920
}
}
}
}
}
}
}
But this query ends up deleting ALL documents of the /products/phone type, including the documents that have the 1433586041 value in 'batch'. What am I doing wrong?