0

I am newbie to ElasticSearch . I am trying to update all the records using following inline script.

ES Version : 5.1.1
POST http://localhost:9200/index_1,index_2/type/_update_by_query?ignore_unavailable=true

{
    "script": {
        "inline": "if(ctx._source.containsKey(\"status\")){ctx._source.status.name = 'UPDATED_STATUS_NAME';ctx._source.status.value = 'UPDATED_STATUS_VALUE';ctx._source.status.name = 'UPDATED_STATUS_NAME';ctx._source.status.value = 'UPDATED_STATUS_VALUE';}"
    }
}

Now consider the following scenario:

1] we hit update by query on ES

2] step 1 is in progress and we get another update request

3] we hit update by query on ES again

4] Now 2 update queries are in progress

I want to know how ElasticSearch will behave in such condition

1] will there be conflicts ?

2] will ES be down since we are hitting update by query on thousand's of documents twice or may be the number of times user wants to perform update operation or rather any risk in above operation

Regards,
Sandeep

1 Answer 1

1

While updating if version conflict of document.

Processing depends on query param contain (?conflicts=proceed? )

1 Passed Will escape version conflicting document rest will get updated .

2 Not passed then document get updated until it get version conflict and operation get abort.

NOTE: In Neither of the case updated documents are not rolled back like RDBS.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.