N
N
Nikita Dergachov2019-02-13 12:48:03
elasticsearch
Nikita Dergachov, 2019-02-13 12:48:03

How to avoid collision in elasticsearch?

After the user updates the data, jobs are created that run asynchronously. What to do if several users change one record, and the older record is written to elastic before the new one. How to avoid it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Cheremisin, 2019-02-13
@vanillathunder

Of course, it will not be great if the old record overwrites the new one.
But we have what we have: the _version field is in a hurry to help - https://www.elastic.co/guide/en/elasticsearch/refe...
The only thing you need is to use the version of the document, if the version does not match, then will give an error.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question