安装插件
bin/plugin install delete-by-query
重启es节点
删除操作:
$client = new Client(['hosts'=>['http://es3.xx.net:9200']]);
$params['index'] = 'cmt_match_goods';
$params['type'] = 'default';
$params['body']['query']['term']['liveid'] = xxx;
$ret = $client->deleteByQuery($params);
参考:
https://www.elastic.co/guide/en/elasticsearch/plugins/2.0/plugins-delete-by-query.html
http://www.developersite.org/905-193975-php