# Update multi fields using "\_update\_by\_query"

**URL:** https://discuss.elastic.co/t/update-multi-fields-using--update-by-query/91565
**Category:** Elasticsearch
**Created:** [July 2, 2017, 4:36pm UTC](https://discuss.elastic.co/t/update-multi-fields-using--update-by-query/91565 "2017-07-02T16:36:08Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Tripti](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tripti/32/19578_2.png) [@Tripti](https://discuss.elastic.co/u/Tripti)
#### Post date: [July 2, 2017, 4:36pm UTC](https://discuss.elastic.co/t/update-multi-fields-using--update-by-query/91565/1 "2017-07-02T16:36:08Z")

</div>

I have to update some documents without specifying \_id of the doc, update\_by\_query is the solution for the same, but it allows me to update only 1 field. Below is the update query I am using for single field update-

POST /user/\_update\_by\_query  
{  
"query": {  
"match": {  
"full\_name": "John"  
}  
},  
"script": {  
"lang" :"painless",  
"inline": "ctx.\_source.full\_name = 'Kim'"  
}  
}

Is it possible to update multi fields using update\_by\_query and script? Although Mvel allows it using separator ';' but it is deprecated.

---

<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 30, 2017, 4:36pm UTC](https://discuss.elastic.co/t/update-multi-fields-using--update-by-query/91565/2 "2017-07-30T16:36:33Z")

</div>

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