0
我有一个场景,我在索引之前通过查询运行多个更新。这导致各种版本冲突。如何通过查询处理更新中的版本冲突Elasticsearch
要求是我不必关心以前的版本,因为如果它正在更新一个新的查询。
我在我的请求中使用了conflict=proceed
,因为我不希望它们中止。但是,这是我不确定与conflict=proceed
选项版本冲突文档实际上正在更新或拒绝。
如果Elasticsearch在版本冲突时没有更新文档,我如何获得这些特定的匹配文档并手动更新它们。
示例代码:
foreach ($this->requests as $request) {
$futures[] = $client->updateByQuery($request);
}
foreach ($futures as $future) {
$future->wait();
if ($future['version_conflicts'] > 0) {
// How to get those documents which were rejected and update them manually. Since I always want to have the last version
}
}
感谢
这意味着如果版本冲突的权利,elasticsearch不会更新文档吗? –