# Bulk Index with version or sequence number

**URL:** <https://discuss.elastic.co/t/bulk-index-with-version-or-sequence-number/188761>\
**Category:** Elasticsearch\
**Created:** [July 3, 2019, 3:42pm UTC](https://discuss.elastic.co/t/bulk-index-with-version-or-sequence-number/188761 "2019-07-03T15:42:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shu\_Shan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shu_shan/32/4939_2.png) [@Shu\_Shan](https://discuss.elastic.co/u/Shu_Shan)\
**Post date:** [July 3, 2019, 3:42pm UTC](https://discuss.elastic.co/t/bulk-index-with-version-or-sequence-number/188761/1 "2019-07-03T15:42:29Z")

</div>

Hello ,  
In order to perform optimistic concurrency locking, we use version OR if\_seq\_no in UPDATE api .

from my understanding, the usual practice is we will have to GET the documents version from ElasticSearch.  
and then used the returned version/if\_seq\_no number along with the UPDATE api call

That seems to work fine if we are updating 1 document.  
What if we are doing Bulk index for a batch of 500 random documents, do we make 500 GET to retrieve the version/sequence\_no for each of them to be used during the bulk insert operation  
?  
what is the common practice of using version/sequence\_no in terms of bulk index to enforce optimistic concurrent locking

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 31, 2019, 3:42pm UTC](https://discuss.elastic.co/t/bulk-index-with-version-or-sequence-number/188761/2 "2019-07-31T15:42:31Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
