# \[Issue #2705\] parent/child DeleteByQuery

**URL:** <https://discuss.elastic.co/t/issue-2705-parent-child-deletebyquery/13539>\
**Category:** Elasticsearch\
**Created:** [September 10, 2013, 1:56pm UTC](https://discuss.elastic.co/t/issue-2705-parent-child-deletebyquery/13539 "2013-09-10T13:56:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Davide\_Palmisano](https://avatars.discourse-cdn.com/v4/letter/d/5daacb/32.png) [@Davide\_Palmisano](https://discuss.elastic.co/u/Davide_Palmisano)\
**Post date:** [September 10, 2013, 1:56pm UTC](https://discuss.elastic.co/t/issue-2705-parent-child-deletebyquery/13539/1 "2013-09-10T13:56:22Z")

</div>

Dear all,

is there anyone who knows if the issue 2705 has been fixed on the latest  
stable  
or it's still open as GitHub says?

Is there a plan to fix it in the next release or maybe is there someone  
that could suggest an elegant workaround solution?

all the best,

--  
Davide Palmisano

> **[Davide Palmisano](http://davidepalmisano.com)**
>
> a long journey to Cantor's infinity

  
[http://twitter.com/dpalmisano](http://twitter.com/dpalmisano)

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)\
**Post date:** [September 10, 2013, 7:59pm UTC](https://discuss.elastic.co/t/issue-2705-parent-child-deletebyquery/13539/2 "2013-09-10T19:59:23Z")

</div>

That is issue is still open. There is as far as I know no effort to fix  
this in the near future. I think right now the best way to delete all  
children belonging to a parent is to do a scan search and bulk the found  
ids in the a bulk request with deletes.

On 10 September 2013 15:56, Davide Palmisano [dpalmisano@gmail.com](mailto:dpalmisano@gmail.com) wrote:

> Dear all,
> 
> is there anyone who knows if the issue 2705 has been fixed on the latest  
> stable  
> or it's still open as GitHub says?
> 
> Is there a plan to fix it in the next release or maybe is there someone  
> that could suggest an elegant workaround solution?
> 
> all the best,
> 
> --  
> Davide Palmisano
> 
> [http://davidepalmisano.com](http://davidepalmisano.com)  
> [http://twitter.com/dpalmisano](http://twitter.com/dpalmisano)
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
Met vriendelijke groet,

Martijn van Groningen

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Davide\_Palmisano](https://avatars.discourse-cdn.com/v4/letter/d/5daacb/32.png) [@Davide\_Palmisano](https://discuss.elastic.co/u/Davide_Palmisano)\
**Post date:** [September 16, 2013, 4:15pm UTC](https://discuss.elastic.co/t/issue-2705-parent-child-deletebyquery/13539/3 "2013-09-16T16:15:15Z")

</div>

Dear all,

is it possible that the CountQuery is affected by issue 2705 as well?

all the best,

On Tue, Sep 10, 2013 at 2:56 PM, Davide Palmisano [dpalmisano@gmail.com](mailto:dpalmisano@gmail.com)wrote:

> Dear all,
> 
> is there anyone who knows if the issue 2705 has been fixed on the latest  
> stable  
> or it's still open as GitHub says?
> 
> Is there a plan to fix it in the next release or maybe is there someone  
> that could suggest an elegant workaround solution?
> 
> all the best,
> 
> --  
> Davide Palmisano
> 
> [http://davidepalmisano.com](http://davidepalmisano.com)  
> [http://twitter.com/dpalmisano](http://twitter.com/dpalmisano)

--  
Davide Palmisano

> **[Davide Palmisano](http://davidepalmisano.com)**
>
> a long journey to Cantor's infinity

[http://twitter.com/dpalmisano](http://twitter.com/dpalmisano)

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)\
**Post date:** [September 16, 2013, 7:29pm UTC](https://discuss.elastic.co/t/issue-2705-parent-child-deletebyquery/13539/4 "2013-09-16T19:29:07Z")

</div>

Yes, the count api is affected as well. Both apis don't execute context  
rewrites, which all the parent/child queries rely on. For the search api  
this is done in the QueryPhase class. For the count api this would be a  
trivial fix. On the other hand you could also just use the count search  
type over the count api, which besides the total count also can compute  
facet counts:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

On 16 September 2013 18:15, Davide Palmisano [dpalmisano@gmail.com](mailto:dpalmisano@gmail.com) wrote:

> Dear all,
> 
> is it possible that the CountQuery is affected by issue 2705 as well?
> 
> all the best,
> 
> On Tue, Sep 10, 2013 at 2:56 PM, Davide Palmisano [dpalmisano@gmail.com](mailto:dpalmisano@gmail.com)wrote:
> 
> > Dear all,
> > 
> > is there anyone who knows if the issue 2705 has been fixed on the latest  
> > stable  
> > or it's still open as GitHub says?
> > 
> > Is there a plan to fix it in the next release or maybe is there someone  
> > that could suggest an elegant workaround solution?
> > 
> > all the best,
> > 
> > --  
> > Davide Palmisano
> > 
> > [http://davidepalmisano.com](http://davidepalmisano.com)  
> > [http://twitter.com/dpalmisano](http://twitter.com/dpalmisano)
> 
> --  
> Davide Palmisano
> 
> [http://davidepalmisano.com](http://davidepalmisano.com)  
> [http://twitter.com/dpalmisano](http://twitter.com/dpalmisano)
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
Met vriendelijke groet,

Martijn van Groningen

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:16am UTC](https://discuss.elastic.co/t/issue-2705-parent-child-deletebyquery/13539/5 "2017-07-06T02:16:14Z")

</div>

Closed on July 6, 2017, 2:16am UTC


