# Can update by script be performed on query results atomically?

**URL:** <https://discuss.elastic.co/t/can-update-by-script-be-performed-on-query-results-atomically/20246>\
**Category:** Elasticsearch\
**Created:** [October 14, 2014, 4:20pm UTC](https://discuss.elastic.co/t/can-update-by-script-be-performed-on-query-results-atomically/20246 "2014-10-14T16:20:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pulkitsinghal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pulkitsinghal/32/802_2.png) [@pulkitsinghal](https://discuss.elastic.co/u/pulkitsinghal)\
**Post date:** [October 14, 2014, 4:20pm UTC](https://discuss.elastic.co/t/can-update-by-script-be-performed-on-query-results-atomically/20246/1 "2014-10-14T16:20:39Z")

</div>

Just like the Update API allows us to update a document based on a script  
provided ... by _removing some network roundtrips_ ... is it possible in ES  
to perform the update on all the results of a query?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/07065c91-7389-4603-a470-29b41ac64dda%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/07065c91-7389-4603-a470-29b41ac64dda%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![pulkitsinghal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pulkitsinghal/32/802_2.png) [@pulkitsinghal](https://discuss.elastic.co/u/pulkitsinghal)\
**Post date:** [October 14, 2014, 6:55pm UTC](https://discuss.elastic.co/t/can-update-by-script-be-performed-on-query-results-atomically/20246/2 "2014-10-14T18:55:51Z")

</div>

Upon further exploration I found  
[https://github.com/yakaz/elasticsearch-action-updatebyquery](https://github.com/yakaz/elasticsearch-action-updatebyquery) ... where the  
update by query API is packaged as a plugin and allows all documents with  
the query to be updated with a script.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/a13c8b4c-13b0-47ca-a3c6-d29f759149f4%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a13c8b4c-13b0-47ca-a3c6-d29f759149f4%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 12:56am UTC](https://discuss.elastic.co/t/can-update-by-script-be-performed-on-query-results-atomically/20246/3 "2017-07-06T00:56:14Z")

</div>


