# Delete by query not working for multiple ids

**URL:** <https://discuss.elastic.co/t/delete-by-query-not-working-for-multiple-ids/7991>\
**Category:** Elasticsearch\
**Created:** [June 6, 2012, 5:45am UTC](https://discuss.elastic.co/t/delete-by-query-not-working-for-multiple-ids/7991 "2012-06-06T05:45:28Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![SG1](https://avatars.discourse-cdn.com/v4/letter/s/3e96dc/32.png) [@SG1](https://discuss.elastic.co/u/SG1)\
**Post date:** [June 6, 2012, 5:45am UTC](https://discuss.elastic.co/t/delete-by-query-not-working-for-multiple-ids/7991/1 "2012-06-06T05:45:28Z")

</div>

I am trying to delete all the indices which matches the id array, when I try to fetch with "ids": {"values":["1","2","3"]} exact data are fetching. but when the same is used for delete it shows as failed.

curl -XDELETE '[http://localhost:9200/mydb.content\_collections/releases/\_query](http://localhost:9200/mydb.content_collections/releases/_query)' -d '{  
"ids" : {  
"values" : ["1" ,"2", "3]  
}  
}

Thanks for your help!

---

<div class="post-metadata">

**Author:** ![rpsandiford](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rpsandiford/32/2206_2.png) [@rpsandiford](https://discuss.elastic.co/u/rpsandiford)\
**Post date:** [June 6, 2012, 1:27pm UTC](https://discuss.elastic.co/t/delete-by-query-not-working-for-multiple-ids/7991/2 "2012-06-06T13:27:44Z")

</div>

I don't suppose the resolution is to add the missing closing quote to ID 3 in your curl command?

Bob Sandiford | Lead Software Engineer | SirsiDynix  
P: 800.288.8020 X6943 | [Bob.Sandiford@sirsidynix.com](mailto:Bob.Sandiford@sirsidynix.com)[mailto:Bob.Sandiford@sirsidynix.com](mailto:Bob.Sandiford@sirsidynix.com)  
[www.sirsidynix.com](http://www.sirsidynix.com)[http://www.sirsidynix.com/](http://www.sirsidynix.com/)

Join the conversation: Like us on Facebook! [http://www.facebook.com/SirsiDynix](http://www.facebook.com/SirsiDynix) Follow us on Twitter! [http://twitter.com/SirsiDynix](http://twitter.com/SirsiDynix)

From: Sumisha [via ElasticSearch Users] [[mailto:ml-node+s115913n4018866h93@n3.nabble.com](mailto:ml-node+s115913n4018866h93@n3.nabble.com)]  
Sent: Wednesday, June 06, 2012 1:45 AM  
To: Bob Sandiford  
Subject: Delete by query not working for multiple ids

I am trying to delete all the indices which matches the id array, when I try to fetch with "ids": {"values":["1","2","3"]} exact data are fetching. but when the same is used for delete it shows as failed.

curl -XDELETE '[http://localhost:9200/mydb.content\_collections/releases/\_query](http://localhost:9200/mydb.content_collections/releases/_query)' -d '{  
"ids" : {  
"values" : ["1" ,"2", "3]  
}  
}

Thanks for your help!

* * *

If you reply to this email, your message will be added to the discussion below:  
[http://elasticsearch-users.115913.n3.nabble.com/Delete-by-query-not-working-for-multiple-ids-tp4018866.html](http://elasticsearch-users.115913.n3.nabble.com/Delete-by-query-not-working-for-multiple-ids-tp4018866.html)  
To start a new topic under ElasticSearch Users, email [ml-node+s115913n115913h50@n3.nabble.com](mailto:ml-node+s115913n115913h50@n3.nabble.com)[mailto:ml-node+s115913n115913h50@n3.nabble.com](mailto:ml-node+s115913n115913h50@n3.nabble.com)  
To unsubscribe from ElasticSearch Users, click here[http://elasticsearch-users.115913.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe\_by\_code&node=115913&code=Ym9iLnNhbmRpZm9yZEBzaXJzaWR5bml4LmNvbXwxMTU5MTN8LTIxMTYxMTI0NTQ=](http://elasticsearch-users.115913.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=115913&code=Ym9iLnNhbmRpZm9yZEBzaXJzaWR5bml4LmNvbXwxMTU5MTN8LTIxMTYxMTI0NTQ=).  
NAML[http://elasticsearch-users.115913.n3.nabble.com/template/NamlServlet.jtp?macro=macro\_viewer&id=instant\_html!nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify\_subscribers!nabble%3Aemail.naml-instant\_emails!nabble%3Aemail.naml-send\_instant\_email!nabble%3Aemail.naml](http://elasticsearch-users.115913.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml)

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [June 10, 2012, 9:09pm UTC](https://discuss.elastic.co/t/delete-by-query-not-working-for-multiple-ids/7991/3 "2012-06-10T21:09:10Z")

</div>

Can you share a full recreation? See [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help).

On Wed, Jun 6, 2012 at 7:45 AM, Sumisha [sumisha@sourcebits.com](mailto:sumisha@sourcebits.com) wrote:

> I am trying to delete all the indices which matches the id array, when I  
> try  
> to fetch with "ids": {"values":["1","2","3"]} exact data are fetching. but  
> when the same is used for delete it shows as failed.
> 
> curl -XDELETE  
> '[http://localhost:9200/mydb.content\_collections/releases/\_query](http://localhost:9200/mydb.content_collections/releases/_query)' -d '{  
> "ids" : {  
> "values" : ["1" ,"2", "3]  
> }  
> }
> 
> Thanks for your help!
> 
> --  
> View this message in context:  
> [http://elasticsearch-users.115913.n3.nabble.com/Delete-by-query-not-working-for-multiple-ids-tp4018866.html](http://elasticsearch-users.115913.n3.nabble.com/Delete-by-query-not-working-for-multiple-ids-tp4018866.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![0xff](https://avatars.discourse-cdn.com/v4/letter/0/5fc32e/32.png) [@0xff](https://discuss.elastic.co/u/0xff)\
**Post date:** [December 6, 2012, 7:04am UTC](https://discuss.elastic.co/t/delete-by-query-not-working-for-multiple-ids/7991/4 "2012-12-06T07:04:41Z")

</div>

Having the same issue. Ended up getting exception

> <https://gist.github.com/anonymous/4222311>

---

<div class="post-metadata">

**Author:** ![0xff](https://avatars.discourse-cdn.com/v4/letter/0/5fc32e/32.png) [@0xff](https://discuss.elastic.co/u/0xff)\
**Post date:** [December 6, 2012, 10:07am UTC](https://discuss.elastic.co/t/delete-by-query-not-working-for-multiple-ids/7991/5 "2012-12-06T10:07:20Z")

</div>

Hi,

I am having the same issue trying to do the same thing.

> <https://gist.github.com/anonymous/4222311>

Thanks in advance

On Monday, June 11, 2012 5:09:10 AM UTC+8, kimchy wrote:

> Can you share a full recreation? See [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help).
> 
> On Wed, Jun 6, 2012 at 7:45 AM, Sumisha \<[sum...@sourcebits.com](mailto:sum...@sourcebits.com)\<javascript:\>
> 
> > wrote:
> 
> > I am trying to delete all the indices which matches the id array, when I  
> > try  
> > to fetch with "ids": {"values":["1","2","3"]} exact data are fetching. but  
> > when the same is used for delete it shows as failed.
> > 
> > curl -XDELETE  
> > '[http://localhost:9200/mydb.content\_collections/releases/\_query](http://localhost:9200/mydb.content_collections/releases/_query)' -d '{  
> > "ids" : {  
> > "values" : ["1" ,"2", "3]  
> > }  
> > }
> > 
> > Thanks for your help!
> > 
> > --  
> > View this message in context:  
> > [http://elasticsearch-users.115913.n3.nabble.com/Delete-by-query-not-working-for-multiple-ids-tp4018866.html](http://elasticsearch-users.115913.n3.nabble.com/Delete-by-query-not-working-for-multiple-ids-tp4018866.html)  
> > Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

--

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [December 7, 2012, 4:28am UTC](https://discuss.elastic.co/t/delete-by-query-not-working-for-multiple-ids/7991/6 "2012-12-07T04:28:27Z")

</div>

Which version of elasticsearch are you using?

On Thursday, December 6, 2012 5:07:20 AM UTC-5, Sara wrote:

> Hi,
> 
> I am having the same issue trying to do the same thing.
> 
> [es\_deletebyquery · GitHub](https://gist.github.com/4222311)
> 
> Thanks in advance
> 
> On Monday, June 11, 2012 5:09:10 AM UTC+8, kimchy wrote:
> 
> > Can you share a full recreation? See [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help).
> > 
> > On Wed, Jun 6, 2012 at 7:45 AM, Sumisha [sum...@sourcebits.com](mailto:sum...@sourcebits.com) wrote:
> > 
> > > I am trying to delete all the indices which matches the id array, when I  
> > > try  
> > > to fetch with "ids": {"values":["1","2","3"]} exact data are fetching.  
> > > but  
> > > when the same is used for delete it shows as failed.
> > > 
> > > curl -XDELETE  
> > > '[http://localhost:9200/mydb.content\_collections/releases/\_query](http://localhost:9200/mydb.content_collections/releases/_query)' -d '{  
> > > "ids" : {  
> > > "values" : ["1" ,"2", "3]  
> > > }  
> > > }
> > > 
> > > Thanks for your help!
> > > 
> > > --  
> > > View this message in context:  
> > > [http://elasticsearch-users.115913.n3.nabble.com/Delete-by-query-not-working-for-multiple-ids-tp4018866.html](http://elasticsearch-users.115913.n3.nabble.com/Delete-by-query-not-working-for-multiple-ids-tp4018866.html)  
> > > Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

--

---

<div class="post-metadata">

**Author:** ![0xff](https://avatars.discourse-cdn.com/v4/letter/0/5fc32e/32.png) [@0xff](https://discuss.elastic.co/u/0xff)\
**Post date:** [December 7, 2012, 10:42am UTC](https://discuss.elastic.co/t/delete-by-query-not-working-for-multiple-ids/7991/7 "2012-12-07T10:42:48Z")

</div>

0.15.2

On Friday, December 7, 2012 12:28:27 PM UTC+8, Igor Motov wrote:

> Which version of elasticsearch are you using?
> 
> On Thursday, December 6, 2012 5:07:20 AM UTC-5, Sara wrote:
> 
> > Hi,
> > 
> > I am having the same issue trying to do the same thing.
> > 
> > [es\_deletebyquery · GitHub](https://gist.github.com/4222311)
> > 
> > Thanks in advance
> > 
> > On Monday, June 11, 2012 5:09:10 AM UTC+8, kimchy wrote:
> > 
> > > Can you share a full recreation? See [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help).
> > > 
> > > On Wed, Jun 6, 2012 at 7:45 AM, Sumisha [sum...@sourcebits.com](mailto:sum...@sourcebits.com) wrote:
> > > 
> > > > I am trying to delete all the indices which matches the id array, when  
> > > > I try  
> > > > to fetch with "ids": {"values":["1","2","3"]} exact data are fetching.  
> > > > but  
> > > > when the same is used for delete it shows as failed.
> > > > 
> > > > curl -XDELETE  
> > > > '[http://localhost:9200/mydb.content\_collections/releases/\_query](http://localhost:9200/mydb.content_collections/releases/_query)' -d '{  
> > > > "ids" : {  
> > > > "values" : ["1" ,"2", "3]  
> > > > }  
> > > > }
> > > > 
> > > > Thanks for your help!
> > > > 
> > > > --  
> > > > View this message in context:  
> > > > [http://elasticsearch-users.115913.n3.nabble.com/Delete-by-query-not-working-for-multiple-ids-tp4018866.html](http://elasticsearch-users.115913.n3.nabble.com/Delete-by-query-not-working-for-multiple-ids-tp4018866.html)  
> > > > Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

--

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [December 7, 2012, 11:15am UTC](https://discuss.elastic.co/t/delete-by-query-not-working-for-multiple-ids/7991/8 "2012-12-07T11:15:36Z")

</div>

The "ids" query was added in 0.16.0. So, it is not available in your  
version. I would encourage upgrading to a more recent release. There were  
significantly improvements in performance and stability since v0.15.2.

On Friday, December 7, 2012 5:42:48 AM UTC-5, Sara wrote:

> 0.15.2
> 
> On Friday, December 7, 2012 12:28:27 PM UTC+8, Igor Motov wrote:
> 
> > Which version of elasticsearch are you using?
> > 
> > On Thursday, December 6, 2012 5:07:20 AM UTC-5, Sara wrote:
> > 
> > > Hi,
> > > 
> > > I am having the same issue trying to do the same thing.
> > > 
> > > [es\_deletebyquery · GitHub](https://gist.github.com/4222311)
> > > 
> > > Thanks in advance
> > > 
> > > On Monday, June 11, 2012 5:09:10 AM UTC+8, kimchy wrote:
> > > 
> > > > Can you share a full recreation? See [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help).
> > > > 
> > > > On Wed, Jun 6, 2012 at 7:45 AM, Sumisha [sum...@sourcebits.com](mailto:sum...@sourcebits.com) wrote:
> > > > 
> > > > > I am trying to delete all the indices which matches the id array, when  
> > > > > I try  
> > > > > to fetch with "ids": {"values":["1","2","3"]} exact data are fetching.  
> > > > > but  
> > > > > when the same is used for delete it shows as failed.
> > > > > 
> > > > > curl -XDELETE  
> > > > > '[http://localhost:9200/mydb.content\_collections/releases/\_query](http://localhost:9200/mydb.content_collections/releases/_query)' -d '{  
> > > > > "ids" : {  
> > > > > "values" : ["1" ,"2", "3]  
> > > > > }  
> > > > > }
> > > > > 
> > > > > Thanks for your help!
> > > > > 
> > > > > --  
> > > > > View this message in context:  
> > > > > [http://elasticsearch-users.115913.n3.nabble.com/Delete-by-query-not-working-for-multiple-ids-tp4018866.html](http://elasticsearch-users.115913.n3.nabble.com/Delete-by-query-not-working-for-multiple-ids-tp4018866.html)  
> > > > > Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

--

---

<div class="post-metadata">

**Author:** ![0xff](https://avatars.discourse-cdn.com/v4/letter/0/5fc32e/32.png) [@0xff](https://discuss.elastic.co/u/0xff)\
**Post date:** [December 10, 2012, 8:48am UTC](https://discuss.elastic.co/t/delete-by-query-not-working-for-multiple-ids/7991/9 "2012-12-10T08:48:48Z")

</div>

Thanks a lot Igor. I will upgrade mine.

On Friday, December 7, 2012 7:15:36 PM UTC+8, Igor Motov wrote:

> The "ids" query was added in 0.16.0. So, it is not available in your  
> version. I would encourage upgrading to a more recent release. There were  
> significantly improvements in performance and stability since v0.15.2.
> 
> On Friday, December 7, 2012 5:42:48 AM UTC-5, Sara wrote:
> 
> > 0.15.2
> > 
> > On Friday, December 7, 2012 12:28:27 PM UTC+8, Igor Motov wrote:
> > 
> > > Which version of elasticsearch are you using?
> > > 
> > > On Thursday, December 6, 2012 5:07:20 AM UTC-5, Sara wrote:
> > > 
> > > > Hi,
> > > > 
> > > > I am having the same issue trying to do the same thing.
> > > > 
> > > > [es\_deletebyquery · GitHub](https://gist.github.com/4222311)
> > > > 
> > > > Thanks in advance
> > > > 
> > > > On Monday, June 11, 2012 5:09:10 AM UTC+8, kimchy wrote:
> > > > 
> > > > > Can you share a full recreation? See [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help)  
> > > > > .
> > > > > 
> > > > > On Wed, Jun 6, 2012 at 7:45 AM, Sumisha [sum...@sourcebits.com](mailto:sum...@sourcebits.com) wrote:
> > > > > 
> > > > > > I am trying to delete all the indices which matches the id array,  
> > > > > > when I try  
> > > > > > to fetch with "ids": {"values":["1","2","3"]} exact data are  
> > > > > > fetching. but  
> > > > > > when the same is used for delete it shows as failed.
> > > > > > 
> > > > > > curl -XDELETE  
> > > > > > '[http://localhost:9200/mydb.content\_collections/releases/\_query](http://localhost:9200/mydb.content_collections/releases/_query)' -d  
> > > > > > '{  
> > > > > > "ids" : {  
> > > > > > "values" : ["1" ,"2", "3]  
> > > > > > }  
> > > > > > }
> > > > > > 
> > > > > > Thanks for your help!
> > > > > > 
> > > > > > --  
> > > > > > View this message in context:  
> > > > > > [http://elasticsearch-users.115913.n3.nabble.com/Delete-by-query-not-working-for-multiple-ids-tp4018866.html](http://elasticsearch-users.115913.n3.nabble.com/Delete-by-query-not-working-for-multiple-ids-tp4018866.html)  
> > > > > > Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

--

---

<div class="post-metadata">

**Author:** ![0xff](https://avatars.discourse-cdn.com/v4/letter/0/5fc32e/32.png) [@0xff](https://discuss.elastic.co/u/0xff)\
**Post date:** [December 11, 2012, 11:49am UTC](https://discuss.elastic.co/t/delete-by-query-not-working-for-multiple-ids/7991/10 "2012-12-11T11:49:42Z")

</div>

Hi Igor,

I have updated my elasticsearch to 0.18.7. Thanks a lot for your advice. I  
am able to now search by list of ids

{  
"query": {  
"ids": {  
"values": [  
"1",  
"2",  
"3"  
]  
}  
}  
}

but I couldn't use ids in my delete by query. Not sure where I am wrong.  
Please find my curl recreation below

curl -XDELETE '[http://localhost:9200/\_all/\_query](http://localhost:9200/_all/_query)' -d '{  
"ids" : {  
"values" : ["1" ,"2", "3"]  
}  
}'

Response:

{"ok":true,"\_indices":{"twitter":{"\_shards":{"total":5,"successful":0,"failed":5}},"com.profyle.profiles":{"\_shards":{"total":5,"successful":0,"failed":5}}}}

Trace:

org.elasticsearch.index.query.QueryParsingException: [twitter] Failed to  
parse  
at  
org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:186)  
at  
org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:175)

On Friday, December 7, 2012 7:15:36 PM UTC+8, Igor Motov wrote:

> The "ids" query was added in 0.16.0. So, it is not available in your  
> version. I would encourage upgrading to a more recent release. There were  
> significantly improvements in performance and stability since v0.15.2.
> 
> On Friday, December 7, 2012 5:42:48 AM UTC-5, Sara wrote:
> 
> > 0.15.2
> > 
> > On Friday, December 7, 2012 12:28:27 PM UTC+8, Igor Motov wrote:
> > 
> > > Which version of elasticsearch are you using?
> > > 
> > > On Thursday, December 6, 2012 5:07:20 AM UTC-5, Sara wrote:
> > > 
> > > > Hi,
> > > > 
> > > > I am having the same issue trying to do the same thing.
> > > > 
> > > > [es\_deletebyquery · GitHub](https://gist.github.com/4222311)
> > > > 
> > > > Thanks in advance
> > > > 
> > > > On Monday, June 11, 2012 5:09:10 AM UTC+8, kimchy wrote:
> > > > 
> > > > > Can you share a full recreation? See [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help)  
> > > > > .
> > > > > 
> > > > > On Wed, Jun 6, 2012 at 7:45 AM, Sumisha [sum...@sourcebits.com](mailto:sum...@sourcebits.com) wrote:
> > > > > 
> > > > > > I am trying to delete all the indices which matches the id array,  
> > > > > > when I try  
> > > > > > to fetch with "ids": {"values":["1","2","3"]} exact data are  
> > > > > > fetching. but  
> > > > > > when the same is used for delete it shows as failed.
> > > > > > 
> > > > > > curl -XDELETE  
> > > > > > '[http://localhost:9200/mydb.content\_collections/releases/\_query](http://localhost:9200/mydb.content_collections/releases/_query)' -d  
> > > > > > '{  
> > > > > > "ids" : {  
> > > > > > "values" : ["1" ,"2", "3]  
> > > > > > }  
> > > > > > }
> > > > > > 
> > > > > > Thanks for your help!
> > > > > > 
> > > > > > --  
> > > > > > View this message in context:  
> > > > > > [http://elasticsearch-users.115913.n3.nabble.com/Delete-by-query-not-working-for-multiple-ids-tp4018866.html](http://elasticsearch-users.115913.n3.nabble.com/Delete-by-query-not-working-for-multiple-ids-tp4018866.html)  
> > > > > > Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

--

---

<div class="post-metadata">

**Author:** ![0xff](https://avatars.discourse-cdn.com/v4/letter/0/5fc32e/32.png) [@0xff](https://discuss.elastic.co/u/0xff)\
**Post date:** [December 11, 2012, 11:51am UTC](https://discuss.elastic.co/t/delete-by-query-not-working-for-multiple-ids/7991/11 "2012-12-11T11:51:52Z")

</div>

Hi Igor,

I have updated my elasticsearch to 0.18.7. Thanks a lot for your advice. I  
am able to now search by list of ids

{  
"query": {  
"ids": {  
"values": [  
"1",  
"2",  
"3"  
]  
}  
}  
}

but I couldn't use ids in my delete by query. Not sure where I am wrong.  
Please find my curl recreation below

curl -XDELETE '[http://localhost:9200/\_all/\_query](http://localhost:9200/_all/_query)' -d '{  
"ids" : {  
"values" : ["1" ,"2", "3"]  
}  
}'

Response:

{"ok":true,"\_indices":{"twitter":{"\_shards":{"total":5,"successful":0,"failed":5}},"com.test":{"\_shards":{"total":5,"successful":0,"failed":5}}}}

Trace:

org.elasticsearch.index.query.QueryParsingException: [twitter] Failed to  
parse  
at  
org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:186)  
at  
org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:175)

Thanks in advance

On Friday, December 7, 2012 7:15:36 PM UTC+8, Igor Motov wrote:

> The "ids" query was added in 0.16.0. So, it is not available in your  
> version. I would encourage upgrading to a more recent release. There were  
> significantly improvements in performance and stability since v0.15.2.
> 
> On Friday, December 7, 2012 5:42:48 AM UTC-5, Sara wrote:
> 
> > 0.15.2
> > 
> > On Friday, December 7, 2012 12:28:27 PM UTC+8, Igor Motov wrote:
> > 
> > > Which version of elasticsearch are you using?
> > > 
> > > On Thursday, December 6, 2012 5:07:20 AM UTC-5, Sara wrote:
> > > 
> > > > Hi,
> > > > 
> > > > I am having the same issue trying to do the same thing.
> > > > 
> > > > [es\_deletebyquery · GitHub](https://gist.github.com/4222311)
> > > > 
> > > > Thanks in advance
> > > > 
> > > > On Monday, June 11, 2012 5:09:10 AM UTC+8, kimchy wrote:
> > > > 
> > > > > Can you share a full recreation? See [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help)  
> > > > > .
> > > > > 
> > > > > On Wed, Jun 6, 2012 at 7:45 AM, Sumisha [sum...@sourcebits.com](mailto:sum...@sourcebits.com) wrote:
> > > > > 
> > > > > > I am trying to delete all the indices which matches the id array,  
> > > > > > when I try  
> > > > > > to fetch with "ids": {"values":["1","2","3"]} exact data are  
> > > > > > fetching. but  
> > > > > > when the same is used for delete it shows as failed.
> > > > > > 
> > > > > > curl -XDELETE  
> > > > > > '[http://localhost:9200/mydb.content\_collections/releases/\_query](http://localhost:9200/mydb.content_collections/releases/_query)' -d  
> > > > > > '{  
> > > > > > "ids" : {  
> > > > > > "values" : ["1" ,"2", "3]  
> > > > > > }  
> > > > > > }
> > > > > > 
> > > > > > Thanks for your help!
> > > > > > 
> > > > > > --  
> > > > > > View this message in context:  
> > > > > > [http://elasticsearch-users.115913.n3.nabble.com/Delete-by-query-not-working-for-multiple-ids-tp4018866.html](http://elasticsearch-users.115913.n3.nabble.com/Delete-by-query-not-working-for-multiple-ids-tp4018866.html)  
> > > > > > Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

--

---

<div class="post-metadata">

**Author:** ![0xff](https://avatars.discourse-cdn.com/v4/letter/0/5fc32e/32.png) [@0xff](https://discuss.elastic.co/u/0xff)\
**Post date:** [December 11, 2012, 11:56am UTC](https://discuss.elastic.co/t/delete-by-query-not-working-for-multiple-ids/7991/12 "2012-12-11T11:56:12Z")

</div>

Hi Igor,

I have updated my elasticsearch to 0.18.7. Thanks a lot for your advice. I  
am able to now search by list of ids

{  
"query": {  
"ids": {  
"values": [  
"1",  
"2",  
"3"  
]  
}  
}  
}

but I couldn't use ids in my delete by query. Not sure where I am wrong.  
Please find my curl recreation below

curl -XDELETE '[http://localhost:9200/\_all/\_query](http://localhost:9200/_all/_query)' -d '{  
"ids" : {  
"values" : ["1" ,"2", "3"]  
}  
}'

Response:

{"ok":true,"\_indices":{"twitter":{"\_shards":{"total":5,"successful":0,"failed":5}},"com.test":{"\_shards":{"total":5,"successful":0,"failed":5}}}}

Trace:

org.elasticsearch.index.query.QueryParsingException: [twitter] Failed to  
parse  
at  
org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:186)  
at  
org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:175)

Updated gist, [es\_deletebyquery · GitHub](https://gist.github.com/4222311)

Thanks in advance

On Friday, December 7, 2012 7:15:36 PM UTC+8, Igor Motov wrote:

> The "ids" query was added in 0.16.0. So, it is not available in your  
> version. I would encourage upgrading to a more recent release. There were  
> significantly improvements in performance and stability since v0.15.2.
> 
> On Friday, December 7, 2012 5:42:48 AM UTC-5, Sara wrote:
> 
> > 0.15.2
> > 
> > On Friday, December 7, 2012 12:28:27 PM UTC+8, Igor Motov wrote:
> > 
> > > Which version of elasticsearch are you using?
> > > 
> > > On Thursday, December 6, 2012 5:07:20 AM UTC-5, Sara wrote:
> > > 
> > > > Hi,
> > > > 
> > > > I am having the same issue trying to do the same thing.
> > > > 
> > > > [es\_deletebyquery · GitHub](https://gist.github.com/4222311)
> > > > 
> > > > Thanks in advance
> > > > 
> > > > On Monday, June 11, 2012 5:09:10 AM UTC+8, kimchy wrote:
> > > > 
> > > > > Can you share a full recreation? See [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help)  
> > > > > .
> > > > > 
> > > > > On Wed, Jun 6, 2012 at 7:45 AM, Sumisha [sum...@sourcebits.com](mailto:sum...@sourcebits.com) wrote:
> > > > > 
> > > > > > I am trying to delete all the indices which matches the id array,  
> > > > > > when I try  
> > > > > > to fetch with "ids": {"values":["1","2","3"]} exact data are  
> > > > > > fetching. but  
> > > > > > when the same is used for delete it shows as failed.
> > > > > > 
> > > > > > curl -XDELETE  
> > > > > > '[http://localhost:9200/mydb.content\_collections/releases/\_query](http://localhost:9200/mydb.content_collections/releases/_query)' -d  
> > > > > > '{  
> > > > > > "ids" : {  
> > > > > > "values" : ["1" ,"2", "3]  
> > > > > > }  
> > > > > > }
> > > > > > 
> > > > > > Thanks for your help!
> > > > > > 
> > > > > > --  
> > > > > > View this message in context:  
> > > > > > [http://elasticsearch-users.115913.n3.nabble.com/Delete-by-query-not-working-for-multiple-ids-tp4018866.html](http://elasticsearch-users.115913.n3.nabble.com/Delete-by-query-not-working-for-multiple-ids-tp4018866.html)  
> > > > > > Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

--

---

<div class="post-metadata">

**Author:** ![0xff](https://avatars.discourse-cdn.com/v4/letter/0/5fc32e/32.png) [@0xff](https://discuss.elastic.co/u/0xff)\
**Post date:** [December 11, 2012, 12:31pm UTC](https://discuss.elastic.co/t/delete-by-query-not-working-for-multiple-ids/7991/13 "2012-12-11T12:31:30Z")

</div>

Tried with terms query and it works though,

curl -XDELETE '[http://localhost:9200/\_all/\_query](http://localhost:9200/_all/_query)' -d '{  
"terms": {  
"\_id": ["1","2","3"]  
}  
}'  
{"ok":true,"\_indices":{"twitter":{"\_shards":{"total":5,"successful":5,"failed":0}},"com.test":{"\_shards":{"total":5,"successful":5,"failed":0}}}

On Tuesday, December 11, 2012 7:56:12 PM UTC+8, Sara wrote:

> Hi Igor,
> 
> I have updated my elasticsearch to 0.18.7. Thanks a lot for your advice. I  
> am able to now search by list of ids
> 
> {  
> "query": {  
> "ids": {  
> "values": [  
> "1",  
> "2",  
> "3"  
> ]  
> }  
> }  
> }
> 
> but I couldn't use ids in my delete by query. Not sure where I am wrong.  
> Please find my curl recreation below
> 
> curl -XDELETE '[http://localhost:9200/\_all/\_query](http://localhost:9200/_all/_query)' -d '{  
> "ids" : {  
> "values" : ["1" ,"2", "3"]  
> }  
> }'
> 
> Response:
> 
> {"ok":true,"\_indices":{"twitter":{"\_shards":{"total":5,"successful":0,"failed":5}},"com.test":{"\_shards":{"total":5,"successful":0,"failed":5}}}}
> 
> Trace:
> 
> org.elasticsearch.index.query.QueryParsingException: [twitter] Failed to  
> parse  
> at  
> org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:186)  
> at  
> org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:175)
> 
> Updated gist, [es\_deletebyquery · GitHub](https://gist.github.com/4222311)
> 
> Thanks in advance
> 
> On Friday, December 7, 2012 7:15:36 PM UTC+8, Igor Motov wrote:
> 
> > The "ids" query was added in 0.16.0. So, it is not available in your  
> > version. I would encourage upgrading to a more recent release. There were  
> > significantly improvements in performance and stability since v0.15.2.
> > 
> > On Friday, December 7, 2012 5:42:48 AM UTC-5, Sara wrote:
> > 
> > > 0.15.2
> > > 
> > > On Friday, December 7, 2012 12:28:27 PM UTC+8, Igor Motov wrote:
> > > 
> > > > Which version of elasticsearch are you using?
> > > > 
> > > > On Thursday, December 6, 2012 5:07:20 AM UTC-5, Sara wrote:
> > > > 
> > > > > Hi,
> > > > > 
> > > > > I am having the same issue trying to do the same thing.
> > > > > 
> > > > > [es\_deletebyquery · GitHub](https://gist.github.com/4222311)
> > > > > 
> > > > > Thanks in advance
> > > > > 
> > > > > On Monday, June 11, 2012 5:09:10 AM UTC+8, kimchy wrote:
> > > > > 
> > > > > > Can you share a full recreation? See  
> > > > > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help).
> > > > > > 
> > > > > > On Wed, Jun 6, 2012 at 7:45 AM, Sumisha [sum...@sourcebits.com](mailto:sum...@sourcebits.com)wrote:
> > > > > > 
> > > > > > > I am trying to delete all the indices which matches the id array,  
> > > > > > > when I try  
> > > > > > > to fetch with "ids": {"values":["1","2","3"]} exact data are  
> > > > > > > fetching. but  
> > > > > > > when the same is used for delete it shows as failed.
> > > > > > > 
> > > > > > > curl -XDELETE  
> > > > > > > '[http://localhost:9200/mydb.content\_collections/releases/\_query](http://localhost:9200/mydb.content_collections/releases/_query)' -d  
> > > > > > > '{  
> > > > > > > "ids" : {  
> > > > > > > "values" : ["1" ,"2", "3]  
> > > > > > > }  
> > > > > > > }
> > > > > > > 
> > > > > > > Thanks for your help!
> > > > > > > 
> > > > > > > --  
> > > > > > > View this message in context:  
> > > > > > > [http://elasticsearch-users.115913.n3.nabble.com/Delete-by-query-not-working-for-multiple-ids-tp4018866.html](http://elasticsearch-users.115913.n3.nabble.com/Delete-by-query-not-working-for-multiple-ids-tp4018866.html)  
> > > > > > > Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

--

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [December 11, 2012, 2:41pm UTC](https://discuss.elastic.co/t/delete-by-query-not-working-for-multiple-ids/7991/14 "2012-12-11T14:41:20Z")

</div>

Any particular reason you stopped at 0.18.7? I would suggest upgrading to  
something more recent. I think the bug that you are now hitting was fixed  
in 0.19 branch.

On Tuesday, December 11, 2012 7:31:30 AM UTC-5, Sara wrote:

> Tried with terms query and it works though,
> 
> curl -XDELETE '[http://localhost:9200/\_all/\_query](http://localhost:9200/_all/_query)' -d '{  
> "terms": {  
> "\_id": ["1","2","3"]  
> }  
> }'
> 
> {"ok":true,"\_indices":{"twitter":{"\_shards":{"total":5,"successful":5,"failed":0}},"com.test":{"\_shards":{"total":5,"successful":5,"failed":0}}}
> 
> On Tuesday, December 11, 2012 7:56:12 PM UTC+8, Sara wrote:
> 
> > Hi Igor,
> > 
> > I have updated my elasticsearch to 0.18.7. Thanks a lot for your advice.  
> > I am able to now search by list of ids
> > 
> > {  
> > "query": {  
> > "ids": {  
> > "values": [  
> > "1",  
> > "2",  
> > "3"  
> > ]  
> > }  
> > }  
> > }
> > 
> > but I couldn't use ids in my delete by query. Not sure where I am wrong.  
> > Please find my curl recreation below
> > 
> > curl -XDELETE '[http://localhost:9200/\_all/\_query](http://localhost:9200/_all/_query)' -d '{  
> > "ids" : {  
> > "values" : ["1" ,"2", "3"]  
> > }  
> > }'
> > 
> > Response:
> > 
> > {"ok":true,"\_indices":{"twitter":{"\_shards":{"total":5,"successful":0,"failed":5}},"com.test":{"\_shards":{"total":5,"successful":0,"failed":5}}}}
> > 
> > Trace:
> > 
> > org.elasticsearch.index.query.QueryParsingException: [twitter] Failed to  
> > parse  
> > at  
> > org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:186)  
> > at  
> > org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:175)
> > 
> > Updated gist, [es\_deletebyquery · GitHub](https://gist.github.com/4222311)
> > 
> > Thanks in advance
> > 
> > On Friday, December 7, 2012 7:15:36 PM UTC+8, Igor Motov wrote:
> > 
> > > The "ids" query was added in 0.16.0. So, it is not available in your  
> > > version. I would encourage upgrading to a more recent release. There were  
> > > significantly improvements in performance and stability since v0.15.2.
> > > 
> > > On Friday, December 7, 2012 5:42:48 AM UTC-5, Sara wrote:
> > > 
> > > > 0.15.2
> > > > 
> > > > On Friday, December 7, 2012 12:28:27 PM UTC+8, Igor Motov wrote:
> > > > 
> > > > > Which version of elasticsearch are you using?
> > > > > 
> > > > > On Thursday, December 6, 2012 5:07:20 AM UTC-5, Sara wrote:
> > > > > 
> > > > > > Hi,
> > > > > > 
> > > > > > I am having the same issue trying to do the same thing.
> > > > > > 
> > > > > > [es\_deletebyquery · GitHub](https://gist.github.com/4222311)
> > > > > > 
> > > > > > Thanks in advance
> > > > > > 
> > > > > > On Monday, June 11, 2012 5:09:10 AM UTC+8, kimchy wrote:
> > > > > > 
> > > > > > > Can you share a full recreation? See  
> > > > > > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help).
> > > > > > > 
> > > > > > > On Wed, Jun 6, 2012 at 7:45 AM, Sumisha [sum...@sourcebits.com](mailto:sum...@sourcebits.com)wrote:
> > > > > > > 
> > > > > > > > I am trying to delete all the indices which matches the id array,  
> > > > > > > > when I try  
> > > > > > > > to fetch with "ids": {"values":["1","2","3"]} exact data are  
> > > > > > > > fetching. but  
> > > > > > > > when the same is used for delete it shows as failed.
> > > > > > > > 
> > > > > > > > curl -XDELETE  
> > > > > > > > '[http://localhost:9200/mydb.content\_collections/releases/\_query](http://localhost:9200/mydb.content_collections/releases/_query)'  
> > > > > > > > -d '{  
> > > > > > > > "ids" : {  
> > > > > > > > "values" : ["1" ,"2", "3]  
> > > > > > > > }  
> > > > > > > > }
> > > > > > > > 
> > > > > > > > Thanks for your help!
> > > > > > > > 
> > > > > > > > --  
> > > > > > > > View this message in context:  
> > > > > > > > [http://elasticsearch-users.115913.n3.nabble.com/Delete-by-query-not-working-for-multiple-ids-tp4018866.html](http://elasticsearch-users.115913.n3.nabble.com/Delete-by-query-not-working-for-multiple-ids-tp4018866.html)  
> > > > > > > > Sent from the Elasticsearch Users mailing list archive at  
> > > > > > > > [Nabble.com](http://Nabble.com).

--

---

<div class="post-metadata">

**Author:** ![0xff](https://avatars.discourse-cdn.com/v4/letter/0/5fc32e/32.png) [@0xff](https://discuss.elastic.co/u/0xff)\
**Post date:** [December 12, 2012, 4:13am UTC](https://discuss.elastic.co/t/delete-by-query-not-working-for-multiple-ids/7991/15 "2012-12-12T04:13:37Z")

</div>

Hi Igor,

Thanks for your reply. I stopped at 0.18.7 because of the grails  
elasticsearch plugin I am using.  
Need to customize the plugin to use the latest version. At the moment I am  
going with the terms query.

Cheers.

On Tuesday, December 11, 2012 10:41:20 PM UTC+8, Igor Motov wrote:

> Any particular reason you stopped at 0.18.7? I would suggest upgrading to  
> something more recent. I think the bug that you are now hitting was fixed  
> in 0.19 branch.
> 
> On Tuesday, December 11, 2012 7:31:30 AM UTC-5, Sara wrote:
> 
> > Tried with terms query and it works though,
> > 
> > curl -XDELETE '[http://localhost:9200/\_all/\_query](http://localhost:9200/_all/_query)' -d '{  
> > "terms": {  
> > "\_id": ["1","2","3"]  
> > }  
> > }'
> > 
> > {"ok":true,"\_indices":{"twitter":{"\_shards":{"total":5,"successful":5,"failed":0}},"com.test":{"\_shards":{"total":5,"successful":5,"failed":0}}}
> > 
> > On Tuesday, December 11, 2012 7:56:12 PM UTC+8, Sara wrote:
> > 
> > > Hi Igor,
> > > 
> > > I have updated my elasticsearch to 0.18.7. Thanks a lot for your advice.  
> > > I am able to now search by list of ids
> > > 
> > > {  
> > > "query": {  
> > > "ids": {  
> > > "values": [  
> > > "1",  
> > > "2",  
> > > "3"  
> > > ]  
> > > }  
> > > }  
> > > }
> > > 
> > > but I couldn't use ids in my delete by query. Not sure where I am wrong.  
> > > Please find my curl recreation below
> > > 
> > > curl -XDELETE '[http://localhost:9200/\_all/\_query](http://localhost:9200/_all/_query)' -d '{  
> > > "ids" : {  
> > > "values" : ["1" ,"2", "3"]  
> > > }  
> > > }'
> > > 
> > > Response:
> > > 
> > > {"ok":true,"\_indices":{"twitter":{"\_shards":{"total":5,"successful":0,"failed":5}},"com.test":{"\_shards":{"total":5,"successful":0,"failed":5}}}}
> > > 
> > > Trace:
> > > 
> > > org.elasticsearch.index.query.QueryParsingException: [twitter] Failed to  
> > > parse  
> > > at  
> > > org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:186)  
> > > at  
> > > org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:175)
> > > 
> > > Updated gist, [es\_deletebyquery · GitHub](https://gist.github.com/4222311)
> > > 
> > > Thanks in advance
> > > 
> > > On Friday, December 7, 2012 7:15:36 PM UTC+8, Igor Motov wrote:
> > > 
> > > > The "ids" query was added in 0.16.0. So, it is not available in your  
> > > > version. I would encourage upgrading to a more recent release. There were  
> > > > significantly improvements in performance and stability since v0.15.2.
> > > > 
> > > > On Friday, December 7, 2012 5:42:48 AM UTC-5, Sara wrote:
> > > > 
> > > > > 0.15.2
> > > > > 
> > > > > On Friday, December 7, 2012 12:28:27 PM UTC+8, Igor Motov wrote:
> > > > > 
> > > > > > Which version of elasticsearch are you using?
> > > > > > 
> > > > > > On Thursday, December 6, 2012 5:07:20 AM UTC-5, Sara wrote:
> > > > > > 
> > > > > > > Hi,
> > > > > > > 
> > > > > > > I am having the same issue trying to do the same thing.
> > > > > > > 
> > > > > > > [es\_deletebyquery · GitHub](https://gist.github.com/4222311)
> > > > > > > 
> > > > > > > Thanks in advance
> > > > > > > 
> > > > > > > On Monday, June 11, 2012 5:09:10 AM UTC+8, kimchy wrote:
> > > > > > > 
> > > > > > > > Can you share a full recreation? See  
> > > > > > > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help).
> > > > > > > > 
> > > > > > > > On Wed, Jun 6, 2012 at 7:45 AM, Sumisha [sum...@sourcebits.com](mailto:sum...@sourcebits.com)wrote:
> > > > > > > > 
> > > > > > > > > I am trying to delete all the indices which matches the id array,  
> > > > > > > > > when I try  
> > > > > > > > > to fetch with "ids": {"values":["1","2","3"]} exact data are  
> > > > > > > > > fetching. but  
> > > > > > > > > when the same is used for delete it shows as failed.
> > > > > > > > > 
> > > > > > > > > curl -XDELETE  
> > > > > > > > > '[http://localhost:9200/mydb.content\_collections/releases/\_query](http://localhost:9200/mydb.content_collections/releases/_query)'  
> > > > > > > > > -d '{  
> > > > > > > > > "ids" : {  
> > > > > > > > > "values" : ["1" ,"2", "3]  
> > > > > > > > > }  
> > > > > > > > > }
> > > > > > > > > 
> > > > > > > > > Thanks for your help!
> > > > > > > > > 
> > > > > > > > > --  
> > > > > > > > > View this message in context:  
> > > > > > > > > [http://elasticsearch-users.115913.n3.nabble.com/Delete-by-query-not-working-for-multiple-ids-tp4018866.html](http://elasticsearch-users.115913.n3.nabble.com/Delete-by-query-not-working-for-multiple-ids-tp4018866.html)  
> > > > > > > > > Sent from the Elasticsearch Users mailing list archive at  
> > > > > > > > > [Nabble.com](http://Nabble.com).

--

---

<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, 3:00am UTC](https://discuss.elastic.co/t/delete-by-query-not-working-for-multiple-ids/7991/16 "2017-07-06T03:00:12Z")

</div>


