elasticsearch2.4.4多行删除

本文档介绍了如何在Elasticsearch 2.4.4中批量删除特定索引和类型下,xxxx字段以'lrz'开头的文档。首先,由于Elasticsearch核心不支持此功能,需要安装Delete By Query插件。通过插件使用Scroll和Bulk APIs来高效安全地删除文档。在安装插件并重启服务后,执行特定的删除命令即可完成删除操作。
摘要由CSDN通过智能技术生成
今天忽然需要删除某个索引下面的某个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

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值