Thank you for your quick response.
To make sure that we understand your reply correctly, could you please clarify the below.
If there are two or more update/upsert requests for the same document id in a bulk request, are they updated/upserted into ES in the same order they have been added into either Bulk processor or into Bulk request object (during ASYNC or SYNC request respectively).
Consider the below example bulk request containing 6 requests.
Request 1 - POST - update/upsert - http://elasticsearch-ip:port/myindex/mytype/id1 {“firstname”:”Johan”, “lastname”:”andy”, “rank”:”5”}
Request 2 - POST - update/upsert - http://elasticsearch-ip:port/myindex/mytype/id2 {“firstname”:”bob”, “lastname”:”raly”, “rank”:”2”}
Request 3 - POST - update/upsert - http://elasticsearch-ip:port/myindex/mytype/id1 {“firstname”:”Johan”, “lastname”:”andy”, “rank”:”3”}
Request 4 - POST - update/upsert - http://elasticsearch-ip:port/myindex/mytype/id1 {“firstname”:”Johan”, “lastname”:”andy”, “rank”:”7”} – this should be the latest document in elastic db for document id (id1)
Request 5 - POST - update/upsert - http://elasticsearch-ip:port/myindex/mytype/id3 {“firstname”:”tony”, “lastname”:”greg”, “rank”:”5”}
Request 6 - POST - update/upsert - http://elasticsearch-ip:port/myindex/mytype/id4 {“firstname”:”paul”, “lastname”:”william”, “rank”:”5”}
As you can see, there are multiple requests for the document ID “id1”. i.e. Request 1, request 3 and request 4 are all for the same document ID “id1”.
In the above example, is it guaranteed that at the end of the bulk request completion, document content for the document ID ‘id1’ will be as per request 4. Or it is not guaranteed.
Thanks in advance.