你不会是程序猿吧?

Python delete_by_query API不起作用

Elasticsearch | 作者 wangchonglie | 发布于2018年06月26日 | 阅读数:4730

body = {
"query": {
"term": {
"厂家": "test"
}
}
}
print(es.search(index=product_index, body=body))
print(es.delete_by_query(index=product_index, doc_type='comp', body=body))
操作如上:
显示结果如下:
{'took': 2, 'timed_out': False, '_shards': {'total': 5, 'successful': 5, 'failed': 0}, 'hits': {'total': 3, 'max_score': 8.75126, 'hits': [{'_index': 'test', '_type': 'comp', '_id': 'AWQ2ZpopYniBlYUIndBa', '_score': 8.75126, '_source': {'厂家': 'test', '类型': '无'}}, {'_index': 'test', '_type': 'comp', '_id': 'AWQ2ZsAEYniBlYUIndBb', '_score': 8.359892, '_source': {'厂家': 'test', '类型': '无'}}, {'_index': 'test', '_type': 'comp', '_id': 'AWQ2xNl0YniBlYUIndBf', '_score': 8.359892, '_source': {'厂家': 'test', '类型': '无'}}]}}
{'_index': 'test', '_type': 'comp', '_id': '_delete_by_query', '_version': 23, '_shards': {'total': 1, 'successful': 1, 'failed': 0}, 'created': False}
在head中查看数据不能被删除,请教大家,麻烦了。
已邀请:

wangchonglie

赞同来自:

elasticsearch 2.3版本中不支持这个api

要回复问题请先登录注册