# 6.4.1: Delete By Query API

**URL:** <https://discuss.elastic.co/t/6-4-1-delete-by-query-api/151975>\
**Category:** Elasticsearch\
**Created:** [October 11, 2018, 6:04am UTC](https://discuss.elastic.co/t/6-4-1-delete-by-query-api/151975 "2018-10-11T06:04:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![pokaleshrey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pokaleshrey/32/48680_2.png) [@pokaleshrey](https://discuss.elastic.co/u/pokaleshrey)\
**Post date:** [October 11, 2018, 6:04am UTC](https://discuss.elastic.co/t/6-4-1-delete-by-query-api/151975/1 "2018-10-11T06:04:04Z")

</div>

Hi,  
I am using 6.4.1 APIs and need to know how does one 'delete by query' in this version. I have initialized my HighLevelRestClient using two coordinating nodes?  
I don't want to use REST call, because i want to connect to my two coordinating nodes and i cannot do that in a REST call.

I understand that it is available on master or on later versions. But i need a way in 6.4.1.

Please help.

---

<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 11, 2018, 7:49am UTC](https://discuss.elastic.co/t/6-4-1-delete-by-query-api/151975/2 "2018-10-11T07:49:37Z")

</div>

> because i want to connect to my two coordinating nodes and i cannot do that in a REST call.

Why?

---

<div class="post-metadata">

**Author:** ![pokaleshrey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pokaleshrey/32/48680_2.png) [@pokaleshrey](https://discuss.elastic.co/u/pokaleshrey)\
**Post date:** [October 11, 2018, 9:05am UTC](https://discuss.elastic.co/t/6-4-1-delete-by-query-api/151975/3 "2018-10-11T09:05:40Z")

</div>

I have two coordinating nodes in my infrastructure. While searching and indexing we use RestHighLevelClient, and initialize it with 2 coordinating hosts.

My Delete by query is a normal rest call and it cannot accept two hosts http://:.  
Previously i had only one coordinating node where above was possible.  
Now i have 2 coord nodes, and i cannot hard code my url to either of them, just to be fail safe.

---

<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 11, 2018, 9:35am UTC](https://discuss.elastic.co/t/6-4-1-delete-by-query-api/151975/4 "2018-10-11T09:35:46Z")

</div>

Once you have the HL Rest Client, you can always access to the lowLeveClient.

Just use this one and it will be connected to one or the other node.

---

<div class="post-metadata">

**Author:** ![pokaleshrey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pokaleshrey/32/48680_2.png) [@pokaleshrey](https://discuss.elastic.co/u/pokaleshrey)\
**Post date:** [October 11, 2018, 9:45am UTC](https://discuss.elastic.co/t/6-4-1-delete-by-query-api/151975/5 "2018-10-11T09:45:43Z")

</div>

Thats good idea. My bad, i didn't think of Low Level Client.

I can use lowLevelClient.performRequest() to make a call.

---

<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 8, 2018, 9:45am UTC](https://discuss.elastic.co/t/6-4-1-delete-by-query-api/151975/6 "2018-11-08T09:45:45Z")

</div>

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