# Parent Fields in Child-Query

**URL:** https://discuss.elastic.co/t/parent-fields-in-child-query/26956
**Category:** Elasticsearch
**Created:** [August 6, 2015, 9:29am UTC](https://discuss.elastic.co/t/parent-fields-in-child-query/26956 "2015-08-06T09:29:50Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Matze](https://avatars.discourse-cdn.com/v4/letter/m/ba8739/32.png) [@Matze](https://discuss.elastic.co/u/Matze)
#### Post date: [August 6, 2015, 9:29am UTC](https://discuss.elastic.co/t/parent-fields-in-child-query/26956/1 "2015-08-06T09:29:50Z")

</div>

Hello everyone,

I have question to querys with parent-child-relationships.

When I do a bool query like this, where I only query fields of the child-type:

{  
"query": {  
"has\_parent": {  
"type": "feature",  
"score\_type": "score",  
"query": {  
"bool" : {  
"should" : [ {  
"query\_string" : {  
"query" : "_costs_",  
"default\_field" : "search.headline",  
"use\_dis\_max" : true,  
"default\_operator" : "and",  
"allow\_leading\_wildcard" : true,  
"boost" : 99.0  
}  
}]  
}  
}  
}  
}  
}

With such a query I get no hits, but when I add another should-clause with a query over a parent fields, then I will get hits. But already with the first should clause, (theoretical) I have to become hits.  
It looks weird. Only adding a query over a parent field helps to get a result.

Can anyone help me?

---

<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 5, 2017, 11:57pm UTC](https://discuss.elastic.co/t/parent-fields-in-child-query/26956/2 "2017-07-05T23:57:08Z")

</div>


