Python 在现有索引中更新时获取版本\u conflict\u eng(409)
我正在更新AWS弹性搜索索引中的一些数据 我正在尝试使用此方法进行更新: 更新方法:Python 在现有索引中更新时获取版本\u conflict\u eng(409),python,php,amazon-web-services,
elasticsearch,version-conflict-engine-exception,Python,Php,Amazon Web Services,
elasticsearch,Version Conflict Engine Exception,我正在更新AWS弹性搜索索引中的一些数据 我正在尝试使用此方法进行更新: 更新方法: $params = [ 'index' => 'my_index', 'id' => 'my_id', 'body' => [ 'doc' => [ 'new_field' => 'abc' ] ]; $response = $client->update($params); 索引映射(JSON): 出现此错误是因为您试图更新索引
$params = [
'index' => 'my_index',
'id' => 'my_id',
'body' => [
'doc' => [
'new_field' => 'abc'
]
];
$response = $client->update($params);
索引映射(JSON):
出现此错误是因为您试图更新索引中有较新版本的文档,Elastic使用乐观锁定进行版本检查以获取有关ES check中版本控制支持的详细信息。请将代码添加为标记。是否可以在现有索引中修复此问题,因为我的索引很重,正在使用更新进行同步?是的,如果您想拥有“最后一次写入wins”角色,您可以避免更新版本。您的另一个选择是为更新创建一个普通脚本,您可以在其中管理版本冲突。有关脚本的文档,请查看此处。
But I am getting the below mentioned error.
Error:
[728376]: version conflict,
required seqNo [145274],
primary term [1].
current document has seqNo [779385] and primary term [2]
Status Code: 409
Type: version_conflict_eng
Index: user
{"user":{"mappings":{"dynamic":"strict","properties":{"EMAIL":{"type":"text"},"FIRSTNAME":{"type":"text"},"MOBILE_NUMBER":{"type":"long"},"NOT_VISIBLE_IDS":{"type":"text"},"SOCIAL_CONTACT":{"type":"nested","include_in_parent":true,"properties":{"DEGREE":{"type":"long"},"FOLLOWER":{"type":"long"}}},"TOTAL_FOLLOWER":{"type":"long"},"USERID":{"type":"long"},"USERNAME":{"type":"text"},"USER_STRING_UNIQUE_ID":{"type":"text"}}}}}
Index Setting(JSON):
{"user":{"settings":{"index":{"mapping":{"nested_objects":{"limit":"2000000"}},"number_of_shards":"5","provided_name":"user","creation_date":"1619021545916","number_of_replicas":"1","uuid":"PzyebOY9SIG-BXl-N9aW8Q","version":{"created":"7010199"}}}}}