# Search across multiple children by single query

**URL:** https://discuss.elastic.co/t/search-across-multiple-children-by-single-query/18283
**Category:** Elasticsearch
**Created:** [June 24, 2014, 8:23am UTC](https://discuss.elastic.co/t/search-across-multiple-children-by-single-query/18283 "2014-06-24T08:23:20Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![jonbondash](https://avatars.discourse-cdn.com/v4/letter/j/ecc23a/32.png) [@jonbondash](https://discuss.elastic.co/u/jonbondash)
#### Post date: [June 24, 2014, 8:23am UTC](https://discuss.elastic.co/t/search-across-multiple-children-by-single-query/18283/1 "2014-06-24T08:23:20Z")

</div>

Hi,

Anyone plz share a sample search query in json where one parent have  
multiple childs & in single query it can search across both childs?

I can fetch each child's parent information using "has\_child". But not able  
to find how to use "has\_child" at a time for two different childs in a  
single query.

Thanks & Regards,  
Jonbon Dash

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/db202e75-15c9-42a5-9741-017b52093fe9%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/db202e75-15c9-42a5-9741-017b52093fe9%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [June 30, 2014, 7:03am UTC](https://discuss.elastic.co/t/search-across-multiple-children-by-single-query/18283/2 "2014-06-30T07:03:31Z")

</div>

Hey,

could you maybe explain where the problem is or which queries you already  
tried so far? A possible solution might be to write a has has\_child query,  
that contains boolean query, which contains to two must clauses, like this:

has\_child : { bool : { must : [term : {}, query\_string : {}] } }

does this make sense? Did this fail? Note, that term and query string are  
just examples...

--Alex

On Tue, Jun 24, 2014 at 10:23 AM, JONBON DASH [jonbonworld@gmail.com](mailto:jonbonworld@gmail.com) wrote:

> Hi,
> 
> Anyone plz share a sample search query in json where one parent have  
> multiple childs & in single query it can search across both childs?
> 
> I can fetch each child's parent information using "has\_child". But not  
> able to find how to use "has\_child" at a time for two different childs in a  
> single query.
> 
> Thanks & Regards,  
> Jonbon Dash
> 
> --  
> 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).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/db202e75-15c9-42a5-9741-017b52093fe9%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/db202e75-15c9-42a5-9741-017b52093fe9%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/db202e75-15c9-42a5-9741-017b52093fe9%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/db202e75-15c9-42a5-9741-017b52093fe9%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAGCwEM-ax3y\_mLoJ535%3DCvaLqFTPM8axADEO8giXFMEim2EPeQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGCwEM-ax3y_mLoJ535%3DCvaLqFTPM8axADEO8giXFMEim2EPeQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:19am UTC](https://discuss.elastic.co/t/search-across-multiple-children-by-single-query/18283/3 "2017-07-06T01:19:04Z")

</div>


