0

我正在尝试更新 AWS 弹性搜索索引中的一些数据,

我正在尝试使用此方法进行更新:

https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/updating_documents.html

更新方法:

$params = [
'index' => 'my_index',
'id'    => 'my_id',
'body'  => [
    'doc' => [
        'new_field' => 'abc'
    ]
];

$response = $client->update($params);

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 

索引映射(JSON):

{"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"}}}}}
4

1 回答 1

0

您收到此错误是因为您正在尝试更新索引中具有较新版本的文档,Elastic 使用乐观锁定进行版本检查,以获取有关 ES check here中版本控制支持的更多信息。

于 2021-05-20T07:43:19.500 回答