# How do I use the Java API to update by query in 5.x?

**URL:** <https://discuss.elastic.co/t/how-do-i-use-the-java-api-to-update-by-query-in-5-x/63942>\
**Category:** Elasticsearch\
**Created:** [October 25, 2016, 10:23pm UTC](https://discuss.elastic.co/t/how-do-i-use-the-java-api-to-update-by-query-in-5-x/63942 "2016-10-25T22:23:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dminkovsky](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dminkovsky/32/12725_2.png) [@dminkovsky](https://discuss.elastic.co/u/dminkovsky)\
**Post date:** [October 25, 2016, 10:23pm UTC](https://discuss.elastic.co/t/how-do-i-use-the-java-api-to-update-by-query-in-5-x/63942/1 "2016-10-25T22:23:16Z")

</div>

Sorry about the silly question: I feel like I must be missing something obvious: I have read about the the update\_by\_query API but I am not finding a way to use it in the Java interface. Is this feature supported in the Java client yet?

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [October 31, 2016, 4:38pm UTC](https://discuss.elastic.co/t/how-do-i-use-the-java-api-to-update-by-query-in-5-x/63942/2 "2016-10-31T16:38:53Z")

</div>

Some nice person answered this over on [stackoverflow](http://stackoverflow.com/questions/37038887/update-by-query-in-elasticsearch-using-java). The answer looks right to me even though it mentions 2.3. Just replace with 5.0.0 and it should work fine.

---

<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 5, 2017, 10:08pm UTC](https://discuss.elastic.co/t/how-do-i-use-the-java-api-to-update-by-query-in-5-x/63942/3 "2017-07-05T22:08:10Z")

</div>


