Hello, relatively new to ES and struggling to delete old records from an 
index("iron") , all of which are the same type ("email"). The idea is to 
purge old data that is no longer of interest.  In the examples below, I'm 
trying to delete all the records from Septemeber of 2013. My use of ES is 
primarily via the Java API, with little experience using curl from the 
command line.

The date/time field is defined like 
this: "tstamp":{"type":"date","format":"dateOptionalTime"}

I have been trying to work from assorted 'delete by query' docs and forum 
suggestions, but so far the result is a puzzling set of failures. I'm sure 
that I'm messing something up on a very basic level since this must be a 
common operation.

This works:

curl -XGET 'http://192.168.4.73:9200/iron/email/_search?pretty=true' -d 
'{"query":{"range":{"tstamp":{"from":"2013-09-01T00:00:00","to":"2013-09-30T23:59:59"}}}}'

This FAILS:

curl -XGET 'http://192.168.4.73:9200/iron/email/_query' -d 
'{"query":{"range":{"tstamp":{"from":"2013-09-01T00:00:00","to":"2013-09-02T23:59:59"}}}}'

Returning: {"_index":"iron","_type":"email","_id":"_query","exists":false}

So of course the -XDELETE based on this query also fails.


Any suggestions appreciated.

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/087de0dd-4e88-40f9-8606-91c6b8aaada3%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to