# Parent child using OR condition between parent and child fields

**URL:** https://discuss.elastic.co/t/parent-child-using-or-condition-between-parent-and-child-fields/124907
**Category:** Elasticsearch
**Created:** [March 21, 2018, 5:39am UTC](https://discuss.elastic.co/t/parent-child-using-or-condition-between-parent-and-child-fields/124907 "2018-03-21T05:39:31Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![muthucse123](https://avatars.discourse-cdn.com/v4/letter/m/6de8d8/32.png) [@muthucse123](https://discuss.elastic.co/u/muthucse123)
#### Post date: [March 21, 2018, 5:39am UTC](https://discuss.elastic.co/t/parent-child-using-or-condition-between-parent-and-child-fields/124907/1 "2018-03-21T05:39:31Z")

</div>

I am trying to query with parent field OR child field. I am using has\_parent to retrieve the parent documents in the response.

How to retrieve all the parent documents even when there is no match for the search term.

"must" : [  
{  
"query\_string": {  
"query": "(headline: business OR Angel)"  
}  
},  
{ "bool" : {  
"should" : [  
{  
"query\_string": {  
"query": "(summary: Unilever)"  
}  
},  
{  
"has\_parent":  
{  
"parent\_type": "publishedarticle",  
"query":  
{  
"query\_string": {  
"query": "(content:"Romania's")"  
}  
},  
"inner\_hits":{  
"highlight":  
{  
"fields":{  
"content":{}  
}  
}  
}  
}  
}  
]  
}}  
]

In the above query i am unable to get parent documents which doesn't have Romania's in it ?

---

<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: [April 18, 2018, 5:39am UTC](https://discuss.elastic.co/t/parent-child-using-or-condition-between-parent-and-child-fields/124907/2 "2018-04-18T05:39:53Z")

</div>

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