daniel anderson
daniel anderson

Reputation: 25

Update issue in elasticsearch

When I try to update documents using the update api, the following error is popping up

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

What is causing the above error and how can I resolve it?

Upvotes: 0

Views: 57

Answers (1)

Thibault Clement
Thibault Clement

Reputation: 2450

When you send your request you specify the version of the doc you want to update ? Something like:

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

The issue is someone (or you) already updated the version 70 so now the version is 71. To resolve your issue, just don't pass the version in the request:

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

Upvotes: 1

Related Questions