Delete all documents from index/type without deleting type

后端 未结 15 531
耶瑟儿~
耶瑟儿~ 2020-12-04 09:45

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

Example:

curl -XDELETE \'http://localhost:9200/twitter/tweet/_query\' -d \         


        
15条回答
  •  囚心锁ツ
    2020-12-04 10:19

    You can delete documents from type with following query:

    POST /index/type/_delete_by_query
    {
        "query" : { 
            "match_all" : {}
        }
    }
    

    I tested this query in Kibana and Elastic 5.5.2

提交回复
热议问题