# How to get both child and parent fields information

**URL:** <https://discuss.elastic.co/t/how-to-get-both-child-and-parent-fields-information/5865>\
**Category:** Elasticsearch\
**Created:** [November 14, 2011, 2:25pm UTC](https://discuss.elastic.co/t/how-to-get-both-child-and-parent-fields-information/5865 "2011-11-14T14:25:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ravikumar\_kotta](https://avatars.discourse-cdn.com/v4/letter/r/977dab/32.png) [@ravikumar\_kotta](https://discuss.elastic.co/u/ravikumar_kotta)\
**Post date:** [November 14, 2011, 2:25pm UTC](https://discuss.elastic.co/t/how-to-get-both-child-and-parent-fields-information/5865/1 "2011-11-14T14:25:06Z")

</div>

Hi,  
I used to "has\_child" to get the child type information of the parent... like following...

curl -XGET '[http://localhost:9200/test/product/\_search?pretty=1](http://localhost:9200/test/product/_search?pretty=1)' -d '{  
"query":{  
"bool":{  
"must":[  
{  
"has\_child":{  
"type":"product\_extra",  
"query":{  
"query\_string":{  
"query":"sports"  
}  
}  
}  
}  
]  
}  
}  
}'

but if i want to search in product\_extra instead of product... what to do.... can u please solve my problem for the reverse ...... and need to get fields from parent type and child type......

---

<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, 3:48am UTC](https://discuss.elastic.co/t/how-to-get-both-child-and-parent-fields-information/5865/2 "2017-07-06T03:48:45Z")

</div>


