Delete documents of type in Elasticsearch

前端 未结 7 1409
南旧
南旧 2021-02-18 16:50

I want to delete all the documents indexed within a type in Elasticsearch, using the HTTP/REST api, but I don\'t want to delete the mapping for this type

How can I build

7条回答
  •  滥情空心
    2021-02-18 17:35

    With the following command in the elasticsearch head plugin I was able to delete all documents of type logs from the logstash index without deleting the mapping:

    {"query":{"match_all":{}}}
    

    Deleting documents with Elasticsearch head plugin

    To free space on the disk you must also optimize the index (Actions->Optimize for index logstash in the head plugin) after deleting the documents.

提交回复
热议问题