今天忽然需要删除某个索引下面的某个type下面的所有xxxx字段以lrz开头的数据,查看elasticsearch2.4.4文档,发现只有根据id一个一个删除,类似如下写法:
$ curl -XDELETE ‘http://localhost:9200/twitter/tweet/1’
查看文档,没有满足该类需求的方法,偶然看见文档如下:
Delete By Query Pluginedit
The delete-by-query plugin adds support for deleting all of the documents (from one or more indices) which match the specified query. It is a replacement for the problematic delete-by-queryfunctionality which has been removed from Elasticsearch core.Internally, it uses Scroll and Bulk APIs to delete documents in an efficient and safe manner. It is slower than the old delete-by-query functionality, but fixes the problems with the previous implementation.
To understand more about why we removed d