# Querieng Parent-child

**URL:** <https://discuss.elastic.co/t/querieng-parent-child/10930>\
**Category:** Elasticsearch\
**Created:** [February 27, 2013, 4:08pm UTC](https://discuss.elastic.co/t/querieng-parent-child/10930 "2013-02-27T16:08:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eran\_Eidinger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eran_eidinger/32/44831_2.png) [@Eran\_Eidinger](https://discuss.elastic.co/u/Eran_Eidinger)\
**Post date:** [February 27, 2013, 4:08pm UTC](https://discuss.elastic.co/t/querieng-parent-child/10930/1 "2013-02-27T16:08:40Z")

</div>

How can I query parents by child attributes? specifically statistics of these attributes?

example: Get all parents that have at least 3 children with a specific value in a specific field?

more specific example: all authors that have at least two books with the horror tag

---

<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:49am UTC](https://discuss.elastic.co/t/querieng-parent-child/10930/2 "2017-07-06T02:49:16Z")

</div>


