Deleting all documents in an index


(Arnaud Ozoukou) #1

Hello,
I have installed latest version (2.1.0) of ElasticSearch. It works very well, you have done a very good job :slight_smile: . I would want to know how to clear all the documents in an index (of a specific type) without deleting the index itself (or if possible the type itself). In previous versions i was able to do that with curl -XDELETE host/index/type/ or by using "Delete by Query" .. but those are not working anymore.
Thank you very much


(David Pilato) #2

You need to install the delete by query plugin now.

Note that it's really a bad idea to delete by a query a full index.
You should really remove the index instead.


(Norberto Meijome) #3

Probably best if you used an alias , create an empty index and swap the
index behind the alias (an atomic operation) - if that is a concern for you
of course.


(Arnaud Ozoukou) #4

Thank you very much, i wil investigate the Alias solution...


(Arnaud Ozoukou) #5

thank you very much , i will try that direction


(system) #6