我正在使用以下代码从elasticsearch中删除文档。
public function deleteByQuery(){
$client = $this->_connectElasticSearchClient();
$params = [
'index' => $this->_indexName,
'type' => $this->_typeName,
'body' => [
'query' => [
'match' => [
'brand' => 'apple'
]
]
]
];
$response = $client->deleteByQuery($params);
print_r($response);die;
}
我得到以下答复。
{
"found": false,
"_index": "gadgets",
"_type": "products",
"_id": "_query",
"_version": 1,
"_shards": {
"total": 1,
"successful": 1,
"failed": 0
}
}
尝试更改查询字符串和all.but无用。在使用上述查询进行搜索时,我也在获取数据。
我正在使用Elasticsearch-PHP Client。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句