I'm confused about the concurrency control of update. It seems that update does check for conflicts:
In between the get and indexing phases of the update, it is possible that another process might have already updated the same document. By default, the update will fail with a version conflict exception.
Also there are two parameters if_seq_no and if_primary_term related to concurrency control. According to the documentation, maybe, the default check of update uses versioning while if_seq_no and if_primary_term can be provided manually. However, according to here maybe checking according to versioning is not reliable and seq_no and primary_term must be used instead. Can I rely on update's own checking for conflicts?
I'm not sure I'm understanding the question. You should use the explicit concurrency control mechanism (i.e. if_seq_no and if_primary_term) if you want explicit control over the behaviour of concurrent operations.
If they want the same behaviour for some other reason. There's only so much you can do with a scripted update. For instance I don't know that you can look things up in an external system during an update, so if you wanted to update a document like this you wouldn't be able to do it in a single update. Instead you would need to get the document, calculate the update outside of Elasticsearch, and then insert the updated document back into Elasticsearch using this explicit concurrency control mechanism.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.