Python/ElasticSearch:批量删除

时间:2021-06-10 21:16:15

标签: python elasticsearch

我有以下代码在 ES 中进行批量删除。

from elasticsearch import Elasticsearch, RequestsHttpConnection
from elasticsearch import helpers, TransportError
        
es = Elasticsearch(hosts=[{'host': host, 'port': port}], connection_class=RequestsHttpConnection)
actions  = [{"delete":{"_index": "my-index", "_id":"my-id"}}]
helpers.bulk(es, actions)

但我收到错误 Validation Failed: 1: index is missing;

我是否正确地形成了“动作”?我确定索引在那里!

0 个答案:

没有答案