我的设置:Elasticsearch 1.4.3(我知道,旧版,旧版)+ python elasticsearch_dsl(或简称http请求)。
我正在尝试使用versioning support但我的文档不包含_version
。 internal
版本默认是否启用?不应该退还吗?
搜索查询的示例(缺少_version
):
"took": 16,
"timed_out": false,
"_shards": {
"total": 4,
"successful": 4,
"failed": 0
},
"hits": {
"total": 32580,
"max_score": null,
"hits": [
{
"_index": "product_87xxxx",
"_type": "product",
"_id": "99104675819",
"_score": null,
"_source": {
"product_score": 86708.2619362192
},
"sort": [
86708.2619362192
]
}
]
}
}
修改
将版本添加到我的scan
查询后,例如:
{
"version": True,
"_source": {"exclude": ["*"]}
}
并尝试执行bulk
:
{"_op_type": "update",
"_id": my_id,
"_version": version,
"_retry_on_conflict": 5,
"_type": "product",
"_index": es_index,
"doc": {"my_field": new_value}}
我得到了:
raised unexpected: RequestError(400, u"ActionRequestValidationException[Validation Failed: 1: can't provide both retry_on_conflict and a specific version;2: can't provide both retry_on_conflict and a specific version; ...
但我希望如果版本更新了更新最新版本(以避免删除由不同并发进程写入的其他字段数据)..尝试仅保留_retry_on_conflict
不起作用..任何想法?
EDIT2:
使用version
而不_retry_on_conflict
投注:
VersionConflictEngineException[[products_8768076][3] [product][99104667848]: version conflict, current [3], provided [1]]