Delete all documents from index/type without deleting type

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

    The Delete-By-Query plugin has been removed in favor of a new Delete By Query API implementation in core. Read here

    curl -XPOST 'localhost:9200/twitter/tweet/_delete_by_query?conflicts=proceed&pretty' -d'
    {
        "query": {
            "match_all": {}
        }
    }'
    

提交回复
热议问题