# Has\_child + min\_children on multi-type

**URL:** <https://discuss.elastic.co/t/has-child-min-children-on-multi-type/74142>\
**Category:** Elasticsearch\
**Created:** [February 6, 2017, 11:14pm UTC](https://discuss.elastic.co/t/has-child-min-children-on-multi-type/74142 "2017-02-06T23:14:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![LiorY89](https://avatars.discourse-cdn.com/v4/letter/l/5f9b8f/32.png) [@LiorY89](https://discuss.elastic.co/u/LiorY89)\
**Post date:** [February 6, 2017, 11:14pm UTC](https://discuss.elastic.co/t/has-child-min-children-on-multi-type/74142/1 "2017-02-06T23:14:49Z")

</div>

I have an index name "relations" which has the following types: relation, person, car  
the relation is the parent, and each relation has 2 children: person & person, car & car, person & car  
person and car both has a field "ref\_id"

now, the user is giving me an input of list of ref\_ids, and i need to bring all the relations that has those id in both of the children.  
my query will be should clause with "has\_child" on type person and another "has\_child" on type car with min\_children:2  
the problem will be in the person-car relation - how i can make a child query with min\_children on 2 different types?

---

<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:** [March 6, 2017, 11:14pm UTC](https://discuss.elastic.co/t/has-child-min-children-on-multi-type/74142/2 "2017-03-06T23:14:58Z")

</div>

Closed on March 6, 2017, 11:14pm UTC

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