# Question about update by query

**URL:** <https://discuss.elastic.co/t/question-about-update-by-query/23464>\
**Category:** Elasticsearch\
**Created:** [April 29, 2015, 10:17am UTC](https://discuss.elastic.co/t/question-about-update-by-query/23464 "2015-04-29T10:17:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Youxu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/youxu/32/117375_2.png) [@Youxu](https://discuss.elastic.co/u/Youxu)\
**Post date:** [April 29, 2015, 10:17am UTC](https://discuss.elastic.co/t/question-about-update-by-query/23464/1 "2015-04-29T10:17:54Z")

</div>

I would like to partial update documents per query.  
Seems this is not implemented in ES yet, the only way is to use the update  
by query plug-in.

> **[yakaz/elasticsearch-action-updatebyquery](https://github.com/yakaz/elasticsearch-action-updatebyquery)**
>
> elasticsearch-action-updatebyquery - ElasticSearch Update By Query action plugin

I checked the example in above site, and know how to update numeric field  
by script:

curl -XPOST 'localhost:9200/twitter/\_update\_by\_query' -d '{ "query" : { "term" : { "message" : "you" } }, "script" : "ctx.\_source.likes += 1"}'

But I still have no idea how to update a text field by query. Example, if I  
have a following doc:  
{"title":"hello", "text":"my text"}

I like something like this:  
{  
"query" : {  
"match" : {  
"title" : "hello"  
}  
},  
"doc" : {  
"text" :"new text"  
}  
}

How can I do?

--  
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/f817d995-e5e0-46a0-8f00-49281f8cacb5%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f817d995-e5e0-46a0-8f00-49281f8cacb5%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:17am UTC](https://discuss.elastic.co/t/question-about-update-by-query/23464/2 "2017-07-06T00:17:06Z")

</div>


