# How get the parent name of a \_doc

**URL:** <https://discuss.elastic.co/t/how-get-the-parent-name-of-a-doc/161599>\
**Category:** Elasticsearch\
**Created:** [December 19, 2018, 10:02pm UTC](https://discuss.elastic.co/t/how-get-the-parent-name-of-a-doc/161599 "2018-12-19T22:02:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hossein\_Ghaheri](https://avatars.discourse-cdn.com/v4/letter/h/c37758/32.png) [@Hossein\_Ghaheri](https://discuss.elastic.co/u/Hossein_Ghaheri)\
**Post date:** [December 19, 2018, 10:02pm UTC](https://discuss.elastic.co/t/how-get-the-parent-name-of-a-doc/161599/1 "2018-12-19T22:02:39Z")

</div>

Hi,  
My document is as follow :

![ss](https://us1.discourse-cdn.com/elastic/original/3X/7/5/75a6e459afc88b3d04c5ab553bc29b8e403fa1e7.png)

I search in this document by name.  
Now i want get parent name of result.  
For example :  
When I search "Red" , i want get this result :  
Red in Colors (parent\_id of Red is 3 & name of 3 id is Colors)  
Or  
When I search "BMW" , i want get this result :  
BMW in Cars (parent\_id of BMW is 1 & name of 1 id is Cars)  
Tnx!

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [December 25, 2018, 6:42am UTC](https://discuss.elastic.co/t/how-get-the-parent-name-of-a-doc/161599/2 "2018-12-25T06:42:55Z")

</div>

That sounds like a join between different documents, which is not supported by Elasticsearch. I would recommend structuring your data in a different way.

---

<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:** [January 22, 2019, 6:42am UTC](https://discuss.elastic.co/t/how-get-the-parent-name-of-a-doc/161599/3 "2019-01-22T06:42:56Z")

</div>

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