Delete all documents from index/type without deleting type

I know one can delete all documents from a certain type via deleteByQuery.

Example:

curl -XDELETE 'http://localhost:9200/twitter/tweet/_query' -d '{
    "query" : {
        "term" : { "user" : "kimchy" }
    }
}'

But i have NO term and simply want to delete all documents from that type, no matter what term. What is best practice to achieve this? Empty term does not work.

Link to deleteByQuery

17 Answers
17

Leave a Comment