我正在尝试根据文档属性的状态更改进行批量更新。Create
工作正常,但bulk
吓坏了。我收到“缺少脚本或文档”的错误,但一切看起来都很好。
这是我尝试批量更新的方式:
frequency_cleared = [
{
"_id": result['_id'],
"_type": "the-type",
"_index": "the-index",
"_source": result['_source'],
"_op_type": 'update'
}
for result in search_results['hits']['hits']
]
我迭代我的结果的原因是我在我的列表理解中使用了 if 但因为我能够看到我得到的结果,所以我知道这不是问题。我无法显示结果,不得不更改属性名称,因为这是我工作的公司。
这是回溯:
Elasticsearch.exceptions.RequestError:
TransportError(400, 'action_request_validation_exception',
'Validation Failed: 1: script or doc is missing...')
省略号表示它对列表中的每个元素都显示相同的错误失败。