I want to delete data in ElasticSearch that matches query. Im using ElasticSeach 1.5 and Im doing this query to achieve this:
POST employee/report/_delete_by_query
{
"query": {
"bool": {
"must": [
[
{ "match_phrase" : { "year_month" : "2016-8" } },
{ "term" : { "status" : "Inactive" } }
]
]
}
}
}
And when I do this, I get this result:
{
"_index": "employee",
"_type": "report",
"_id": "_delete_by_query",
"_version": 6,
"created": false
}
Every time I run the query, the _version numbers gets +1. Then I query the terms deleted, to check that there're no more results:
GET employee/report/_search
{
"query": {
"bool": {
"must": [
[
{ "match_phrase" : { "year_month" : "2016-8" } },
{ "term" : { "status" : "Inactive" } }
]
]
}
}
}
And Im still getting results! What Im doing wrong? Do I need to refresh ElasticSearch? Im missing some step?