i'm using delete by query plugins for elastic search.
I have a index products
with a integer field size
. I want delete all document with size 10. I have over 5000 documents with size 10. If i try:
DELETE /products/product/_query?q=size:10
this query requires over 2 minutes.
I understand because delete by query
plugin is slow, from documentation:
Internally, it uses Scroll and Bulk APIs to delete documents in an efficient and safe manner. It is slower [..] Queries which match large numbers of documents may run for a long time, as every document has to be deleted individually.
How do i perform a fastest documents mass deleting?
You can't. This is the only supported way of deleting documents in latest versions of Elasticsearch. Elasticsearch 1.x deletes much faster (but potentially in an unsafe manner). So if it is really worth so much, you can go back to an older version of Elasticsearch.