# Searching nested objects with parent-child relationship

**URL:** <https://discuss.elastic.co/t/searching-nested-objects-with-parent-child-relationship/191687>\
**Category:** Elasticsearch\
**Created:** [July 22, 2019, 5:03pm UTC](https://discuss.elastic.co/t/searching-nested-objects-with-parent-child-relationship/191687 "2019-07-22T17:03:34Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [July 23, 2019, 12:50pm UTC](https://discuss.elastic.co/t/searching-nested-objects-with-parent-child-relationship/191687/4 "2019-07-23T12:50:13Z")

</div>

> [@Slobbard](#):
>
> Should I change my mapping or my query then?

You need to decide if you want parent/child or nested (this [flowchart](https://discuss.elastic.co/t/indexing-hierarchical-couchbase-documents/70400/2) can help) then ensure that your indexing and querying use the appropriate parameters for that choice.

> [@Slobbard](#):
>
> Is there a way to query children and fetch also parents' data?

[Yep.](https://www.elastic.co/guide/en/elasticsearch/reference/current/parent-join.html#_parent_join_queries_and_aggregations)

---

_[View the full topic](https://discuss.elastic.co/t/searching-nested-objects-with-parent-child-relationship/191687)._
