On my elasticsearch 1.4 I used to delete documents using the DeleteByQuery API like this :
curl -XDELETE http://my_elasticsearch:9200/_all/_query?q=some_field:some_value
This wasn't perfect (because of regular OutOfMemoryError) but this works enough for my needs (at this time).
But now I use the new elasticsearch 1.5 and in the documentation I have read that :
Deprecated in 1.5.0.
"Delete by Query will be removed in 2.0: it is problematic since it silently forces a refresh which can quickly cause OutOfMemoryError during concurrent indexing, and can also cause primary and replica to become inconsistent. Instead, use the scroll/scan API to find all matching ids and then issue a bulk request to delete them..
So I would like to do the same using scroll/scan API. But how to delete using this? I don't understand how. The documentation API and documentation Java API doesn't seems complete for me (missing example of deleting).
PS: I'm looking for understand with java or curl (no matter for me in final I need the both).