Delete all documents from index/type without deleting type

后端 未结 15 498
耶瑟儿~
耶瑟儿~ 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:21

    From ElasticSearch 5.x, delete_by_query API is there by default

    POST: http://localhost:9200/index/type/_delete_by_query

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

提交回复
热议问题