# How to query document to return parent and child result

**URL:** <https://discuss.elastic.co/t/how-to-query-document-to-return-parent-and-child-result/13223>\
**Category:** Elasticsearch\
**Created:** [August 15, 2013, 3:37am UTC](https://discuss.elastic.co/t/how-to-query-document-to-return-parent-and-child-result/13223 "2013-08-15T03:37:28Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Atul\_Bagga](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/atul_bagga/32/15047_2.png) [@Atul\_Bagga](https://discuss.elastic.co/u/Atul_Bagga)\
**Post date:** [March 2, 2017, 1:17pm UTC](https://discuss.elastic.co/t/how-to-query-document-to-return-parent-and-child-result/13223/3 "2017-03-02T13:17:00Z")

</div>

Actually I found this thread now which is helpful on this-

> [@Querying both parent as child document fields](https://discuss.elastic.co/t/querying-both-parent-as-child-document-fields/12019):
>
> Hello, I'm struggling a bit to write a query that would query fields on a parent document and the fields on a child document. first thought, my mapping: I have documents of type 'resource' (these are the parent docs) which have a couple of fields, the ones I'll be querying are called 'q\_high' and 'q\_low'. I also have documents of type 'message' (the child documents) which have the same q\_high and q\_low fields We've modelled it this way as all top level resources can have messages assoc…

---

_[View the full topic](https://discuss.elastic.co/t/how-to-query-document-to-return-parent-and-child-result/13223)._
