更新elasticsearch中的问题

时间:2016-02-01 11:52:33

标签: elasticsearch

当我尝试使用更新api更新文档时,会弹出以下错误

{"error":"RemoteTransportExceptiones-node9][inet[/10.130.89.220:9300[indices:data/write/update]]; nested: VersionConflictEngineExceptionnewsentiments][3] [relevancy][abc@gmail.com]: version conflict, current [71], provided [70; ","status":409}

导致上述错误的原因是什么?如何解决?

1 个答案:

答案 0 :(得分:1)

发送请求时,请指定要更新的文档的版本?类似的东西:

curl -XPUT 'localhost:9200/myIndex/MyType/1?version=70' -d '{
    "content" : "here is my update"
}'

问题是有人(或您)已经更新了版本70,所以现在版本是71。 要解决您的问题,请不要在请求中传递该版本:

curl -XPUT 'localhost:9200/myIndex/MyType/1' -d '{
    "content" : "here is my update"
}'