# Update\_by\_query in ElasticSearch

**URL:** <https://discuss.elastic.co/t/update-by-query-in-elasticsearch/106530>\
**Category:** Elasticsearch\
**Created:** [November 6, 2017, 1:19pm UTC](https://discuss.elastic.co/t/update-by-query-in-elasticsearch/106530 "2017-11-06T13:19:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ssg](https://avatars.discourse-cdn.com/v4/letter/s/e68b1a/32.png) [@ssg](https://discuss.elastic.co/u/ssg)\
**Post date:** [November 6, 2017, 1:19pm UTC](https://discuss.elastic.co/t/update-by-query-in-elasticsearch/106530/1 "2017-11-06T13:19:14Z")

</div>

Hi All,

I am newbie to ElasticSearch . I am trying to update all the records using following inline script.

ES Version : 5.1.1  
POST [http://localhost:9200/index\_1,index\_2/type/\_update\_by\_query?ignore\_unavailable=true](http://localhost:9200/index_1,index_2/type/_update_by_query?ignore_unavailable=true)  
{  
"script": {  
"inline": "if(ctx.\_source.containsKey("status")){ctx.\_source.status.name = 'UPDATED\_STATUS\_NAME';ctx.\_source.status.value = 'UPDATED\_STATUS\_VALUE';ctx.\_source.status.name = 'UPDATED\_STATUS\_NAME';ctx.\_source.status.value = 'UPDATED\_STATUS\_VALUE';}"  
}  
}

Now consider the following scenario:  
1] we hit update by query on ES  
2] step 1 is in progress and we get another update request  
3] we hit update by query on ES again.  
4] Now 2 update queries are in progress.

I want to know how ElasticSearch will behave in such condition.  
will there be conflicts ?  
will ES be down since we are hitting update by query on thousand's of documents twice or may be the number of times user wants to perform update operation.

Regards,  
Sandeep

---

<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:** [December 4, 2017, 1:19pm UTC](https://discuss.elastic.co/t/update-by-query-in-elasticsearch/106530/2 "2017-12-04T13:19:18Z")

</div>

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