问下怎么按条件删除 elasticsearch 的值
我用的是elasticsearch 5.6, 我把数据
[
'index'=>'test',
'type'=>'a',
'body'=>[[
'id'=>0
'one'=>111,
'two'=>222
]]
]
存入elasticsearch,然后我现在想根据 id 条件来删除 数据,
$param = [
'index'=>'test',
'type'=>'a',
'body'=>[
'query'=>[
'id'=>[
'gt'=>0,
'lt'=>10
]
]
]
];
$res = $es_client->deleteByQuery($param);
这种方式删除,但没有成功,
0又不在0<x<10范围内,怎么删除
刚好写完 ES 删除 发一下供你参考吧;装个kibana在上边先把查询写出来 再对应换成PHP的数组结构就可以了