# \_update API in elastic search

**URL:** <https://discuss.elastic.co/t/-update-api-in-elastic-search/16733>\
**Category:** Elasticsearch\
**Created:** [April 1, 2014, 7:06am UTC](https://discuss.elastic.co/t/-update-api-in-elastic-search/16733 "2014-04-01T07:06:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prashant\_Pal](https://avatars.discourse-cdn.com/v4/letter/p/b77776/32.png) [@Prashant\_Pal](https://discuss.elastic.co/u/Prashant_Pal)\
**Post date:** [April 1, 2014, 7:06am UTC](https://discuss.elastic.co/t/-update-api-in-elastic-search/16733/1 "2014-04-01T07:06:40Z")

</div>

Hi ES users,

Can we perform the \_update query to multiple Id's.

For example if I want to update the Time field of my Index/type/id as below:  
curl -xPOST [http://192.168.0.164:9200/](http://192.168.0.164:9200/) **prashant\_cata/session/123** /\_update -d '{

"script": "ctx.\_source.Time = "2014-03-25T14:31:12""  
}'

So is there anyway I can update the Time field of all docs like:  
curl -xPOST [http://192.168.0.164:9200/](http://192.168.0.164:9200/) **prashant\_cata/session/\*** /\_update -d '{

"script": "ctx.\_source.Time = "2014-03-25T14:31:12""  
}'

Or is there any other way around for this scenario.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 1, 2014, 7:56am UTC](https://discuss.elastic.co/t/-update-api-in-elastic-search/16733/2 "2014-04-01T07:56:44Z")

</div>

You are looking for this: [https://github.com/elasticsearch/elasticsearch/issues/1607](https://github.com/elasticsearch/elasticsearch/issues/1607)

May be this plugin could help: [https://github.com/yakaz/elasticsearch-action-updatebyquery](https://github.com/yakaz/elasticsearch-action-updatebyquery) in the meantime.

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 1 avril 2014 à 09:06:43, Prashant Agrawal ([prashant.agrawal@paladion.net](mailto:prashant.agrawal@paladion.net)) a écrit:

Hi ES users,

Can we perform the \_update query to multiple Id's.

For example if I want to update the Time field of my Index/type/id as below:  
curl -xPOST [http://192.168.0.164:9200/](http://192.168.0.164:9200/)_prashant\_cata/session/123_/\_update -d  
'{

"script": "ctx.\_source.Time = "2014-03-25T14:31:12""  
}'

So is there anyway I can update the Time field of all docs like:  
curl -xPOST [http://192.168.0.164:9200/\*prashant\_cata/session/\*\*/\_update](http://192.168.0.164:9200/*prashant_cata/session/**/_update) -d  
'{

"script": "ctx.\_source.Time = "2014-03-25T14:31:12""  
}'

Or is there any other way around for this scenario.

--  
View this message in context: [http://elasticsearch-users.115913.n3.nabble.com/update-API-in-elastic-search-tp4053216.html](http://elasticsearch-users.115913.n3.nabble.com/update-API-in-elastic-search-tp4053216.html)  
Sent from the ElasticSearch Users mailing list archive at [Nabble.com](http://Nabble.com).

--  
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/1396336000440-4053216.post%40n3.nabble.com](https://groups.google.com/d/msgid/elasticsearch/1396336000440-4053216.post%40n3.nabble.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/etPan.533a713c.12e685fb.16bdd%40MacBook-Air-de-David.local](https://groups.google.com/d/msgid/elasticsearch/etPan.533a713c.12e685fb.16bdd%40MacBook-Air-de-David.local).  
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, 1:39am UTC](https://discuss.elastic.co/t/-update-api-in-elastic-search/16733/3 "2017-07-06T01:39:06Z")

</div>


