I have a code that find records what I need:
curl -XGET "http://localhost:9200/one/two/_search" -d '
{
"query" : {
"range" : {
"timestamp" : { "gte" : "2014-09-01T00:00:00.000Z", "lt" : "2014-09-01T00:00:00.000Z||+1M"}
}
}
}'
Now I want to transform it to code that will delete these records.
According to this doc I tried to change _search to query and got:
{"_index":"one","_type":"two","_id":"_query","found":false}
I tried to change XGET to XDELETE:
{"found":false,"_index":"one","_type":"two","_id":"_search","_version":1}
Elasticsearch version:
"version" : {
"number" : "1.0.3",
"build_hash" : "61bfb72d845a59a58cd9910e47515665f6478a5c",
"build_timestamp" : "2014-04-16T14:43:11Z",
"build_snapshot" : false,
"lucene_version" : "4.6"
}
What is the right query to delete these records?