我有以下代码在 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;
。
我是否正确地形成了“动作”?我确定索引在那里!