Monday, September 7, 2015

Delete documents in Elasticsearch

If you want to delete documents of a specific type,

you can delete the documents as follows:

$ curl -XDELETE http://localhost:9200/logstash-2015.09.05/logs                          
{"acknowledged":true}
$

If you want to delete documents of all types under a specific index,

you can delete the documents as follows:

$ curl -XDELETE http://localhost:9200/logstash-2015.09.05                                
{"acknowledged":true}
$

References:
http://stackoverflow.com/questions/23917327/delete-all-documents-from-index-type-without-deleting-type
https://www.elastic.co/blog/what-is-an-elasticsearch-index

No comments:

Post a Comment