# Delete By Query using Java High Level Rest Client

**URL:** https://discuss.elastic.co/t/delete-by-query-using-java-high-level-rest-client/102507
**Category:** Elasticsearch
**Created:** [October 3, 2017, 5:08am UTC](https://discuss.elastic.co/t/delete-by-query-using-java-high-level-rest-client/102507 "2017-10-03T05:08:23Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![kumar1993](https://avatars.discourse-cdn.com/v4/letter/k/8baadc/32.png) [@kumar1993](https://discuss.elastic.co/u/kumar1993)
#### Post date: [October 3, 2017, 5:08am UTC](https://discuss.elastic.co/t/delete-by-query-using-java-high-level-rest-client/102507/1 "2017-10-03T05:08:23Z")

</div>

Is there a way to achieve delete by query using the java high level rest client ? previously i was using transport client to achieve the same thing, turns out that there is no straight forward way of doing this with the high level rest client.

---

<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: [October 3, 2017, 5:56am UTC](https://discuss.elastic.co/t/delete-by-query-using-java-high-level-rest-client/102507/2 "2017-10-03T05:56:33Z")

</div>

I think this is something you could ask as a feature request on GitHub.  
Not sure how hard it will be to implement though.

For now you need to write a query may be using query builders, transform as JSon string and pass the string to the low level client.

---

<div class="post-metadata">

### Author: ![lengerad](https://avatars.discourse-cdn.com/v4/letter/l/f1d935/32.png) [@lengerad](https://discuss.elastic.co/u/lengerad)
#### Post date: [October 9, 2017, 12:39pm UTC](https://discuss.elastic.co/t/delete-by-query-using-java-high-level-rest-client/102507/3 "2017-10-09T12:39:09Z")

</div>

I run into the same use case and found your topic here. I've created an issue on github so you can track the progress (hope it will be implemented)

> <https://github.com/elastic/elasticsearch/issues/26928>

---

<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: [November 6, 2017, 12:39pm UTC](https://discuss.elastic.co/t/delete-by-query-using-java-high-level-rest-client/102507/4 "2017-11-06T12:39:14Z")

</div>

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