elasticsearch通过批量id进行数据删除

Writing in the front

In the reproduction environment,we neet delet the data according to the ids.So we need branch query statement.

_delete_by_query

‘_delete_by_query’ used by post and this statement can help delete data by query.But I need delete with not include these id.So we can use ‘must_not’ and ‘ids’ query.

POST /cool-user-index/_delete_by_query
{
  "query": {
    "bool": {
      "must_not": [
        {
          "ids": {
            "values": [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,19,20,21,22,23,24,25,26,27,29,30,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,54,58,59,60,61,63,64,75,76,77,78,79,80,81,82,83,84,85,86,100,101,102,103,104,105,106,107,110,111,129,134,135,136,140,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184]
          }
        }
      ]
    }
  }
}
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值