# Updates in multiple fields in update api

**URL:** <https://discuss.elastic.co/t/updates-in-multiple-fields-in-update-api/7859>\
**Category:** Elasticsearch\
**Created:** [May 25, 2012, 8:32am UTC](https://discuss.elastic.co/t/updates-in-multiple-fields-in-update-api/7859 "2012-05-25T08:32:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![narinder\_izap](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/narinder_izap/32/803_2.png) [@narinder\_izap](https://discuss.elastic.co/u/narinder_izap)\
**Post date:** [May 25, 2012, 8:32am UTC](https://discuss.elastic.co/t/updates-in-multiple-fields-in-update-api/7859/1 "2012-05-25T08:32:49Z")

</div>

Hi there,  
as per update api at  
[http://www.elasticsearch.org/guide/reference/api/update.html](http://www.elasticsearch.org/guide/reference/api/update.html), its working  
fine, but is it possible to _update multiple fields in a single update  
request_, so that we can reduce the network round trips and more over the  
document will be indexed once only...

Thanks

---

<div class="post-metadata">

**Author:** ![Benjamin\_Deveze](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/benjamin_deveze/32/1577_2.png) [@Benjamin\_Deveze](https://discuss.elastic.co/u/Benjamin_Deveze)\
**Post date:** [May 25, 2012, 12:08pm UTC](https://discuss.elastic.co/t/updates-in-multiple-fields-in-update-api/7859/2 "2012-05-25T12:08:45Z")

</div>

Hi,

you can use the update api to update multiple fields in a single  
update request. You can (in mvel, which is the default scripting used)  
separate each instruction by ";" within a single script.

On Fri, May 25, 2012 at 10:32 AM, Narinder Kaur [narinder.kaur@izap.in](mailto:narinder.kaur@izap.in) wrote:

> Hi there,  
> as per update api  
> at [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/update.html), its working  
> fine, but is it possible to update multiple fields in a single update  
> request, so that we can reduce the network round trips and more over the  
> document will be indexed once only...
> 
> Thanks

--  
Benjamin DEVEZE

---

<div class="post-metadata">

**Author:** ![narinder\_izap](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/narinder_izap/32/803_2.png) [@narinder\_izap](https://discuss.elastic.co/u/narinder_izap)\
**Post date:** [May 28, 2012, 6:24am UTC](https://discuss.elastic.co/t/updates-in-multiple-fields-in-update-api/7859/3 "2012-05-28T06:24:28Z")

</div>

thanks for the help

On Friday, 25 May 2012 17:38:45 UTC+5:30, Benjamin Devèze wrote:

> Hi,
> 
> you can use the update api to update multiple fields in a single  
> update request. You can (in mvel, which is the default scripting used)  
> separate each instruction by ";" within a single script.
> 
> On Fri, May 25, 2012 at 10:32 AM, Narinder Kaur wrote:
> 
> > Hi there,  
> > as per update api  
> > at [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/update.html), its  
> > working  
> > fine, but is it possible to update multiple fields in a single update  
> > request, so that we can reduce the network round trips and more over the  
> > document will be indexed once only...
> > 
> > Thanks
> 
> --  
> Benjamin DEVEZE

---

<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, 3:26am UTC](https://discuss.elastic.co/t/updates-in-multiple-fields-in-update-api/7859/4 "2017-07-06T03:26:47Z")

</div>


