# UpdateByQuery plugin problem

**URL:** https://discuss.elastic.co/t/updatebyquery-plugin-problem/20052
**Category:** Elasticsearch
**Created:** [October 2, 2014, 2:05pm UTC](https://discuss.elastic.co/t/updatebyquery-plugin-problem/20052 "2014-10-02T14:05:54Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Peter\_Falcon](https://avatars.discourse-cdn.com/v4/letter/p/ecd19e/32.png) [@Peter\_Falcon](https://discuss.elastic.co/u/Peter_Falcon)
#### Post date: [October 2, 2014, 2:05pm UTC](https://discuss.elastic.co/t/updatebyquery-plugin-problem/20052/1 "2014-10-02T14:05:54Z")

</div>

I want to update records in ElasticSearch by query. For this purpose I used  
UpdateByQuery plugin, but I can't figure out  
how to force it to work properly. Here my updateByQuery:  
{  
"query": {  
"term": {  
"patix\_id": "87344"  
}  
},  
"script": "ctx.\_source.firstName = "TEST""  
}  
For it I get this response:  
{  
ok: true  
took: 30  
total: 1  
updated: 0  
indices: [  
{  
reception: { }  
}  
]  
}  
I don't know why this query is not updating anything (_updated: 0_)  
although it can find the target row (_total: 1_).  
What I'm doing wrong? The updated record ("patix\_id": "87344") surely  
exists in ElasticSearch index (reception).  
I use 'ElasticSearch 1.3.2' and  
'com.yakaz.elasticsearch.plugins/elasticsearch-action-updatebyquery/2.2.0'.

Peter

--  
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/e4596ee3-6602-4abb-8733-a6cbafa22e27%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e4596ee3-6602-4abb-8733-a6cbafa22e27%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:58am UTC](https://discuss.elastic.co/t/updatebyquery-plugin-problem/20052/2 "2017-07-06T00:58:40Z")

</div>


