【发布时间】:2016-05-12 23:11:03
【问题描述】:
我正在尝试根据文档属性的状态更改进行批量更新。 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...')
省略号表示它对列表中的每个元素都显示相同的错误失败。
【问题讨论】:
标签: python elasticsearch elasticsearch-py