# Select and Update

**URL:** <https://discuss.elastic.co/t/select-and-update/179870>\
**Category:** Elasticsearch\
**Created:** [May 7, 2019, 2:41am UTC](https://discuss.elastic.co/t/select-and-update/179870 "2019-05-07T02:41:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![han1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/han1/32/20141_2.png) [@han1](https://discuss.elastic.co/u/han1)\
**Post date:** [May 7, 2019, 2:41am UTC](https://discuss.elastic.co/t/select-and-update/179870/1 "2019-05-07T02:41:14Z")

</div>

Hi.  
We are trying to do the following and any help would be appreciated.  
Say you make a search and 100,000 documents match.  
We would like to increment a counter in each document that matched. Then at the same time select the first page say the first 50.

Can this be done in one operation or may be a parallel scenario.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [May 8, 2019, 8:16am UTC](https://discuss.elastic.co/t/select-and-update/179870/2 "2019-05-08T08:16:39Z")

</div>

Read and write operations are always separated from each other. So you'd have on operation doing the counter incrementing and one doing the query.

---

<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:** [June 5, 2019, 8:16am UTC](https://discuss.elastic.co/t/select-and-update/179870/3 "2019-06-05T08:16:49Z")

</div>

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