【发布时间】:2018-01-04 18:38:16
【问题描述】:
我是 ElasticSearch 的新手。我正在尝试使用 python 从 http://localhost:9200/es_index/es_type 中删除一组数据。
假设 x=['a','b','c','d','e','f'] 是我要删除的 _ids 列表
代码:
from elasticsearch import Elasticsearch
es = Elasticsearch()
request_body = {
"query": {
"ids": {
"values": ['a','b','c','d','e','f']
}
}
}
es.delete_by_query(index=es_index, body=request_body)
但是当我检查 http://localhost:9200/es_index/es_type 时,数据仍然存在。
【问题讨论】:
-
你运行的是哪个版本的 ES?
-
版本为6.1.0
-
elasticsearch-py是哪个版本的?
标签: python elasticsearch