# How to exclude specific child document

**URL:** https://discuss.elastic.co/t/how-to-exclude-specific-child-document/88859
**Category:** Elasticsearch
**Created:** [June 9, 2017, 3:37pm UTC](https://discuss.elastic.co/t/how-to-exclude-specific-child-document/88859 "2017-06-09T15:37:15Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![mongesh\_madhavan](https://avatars.discourse-cdn.com/v4/letter/m/ed8c4c/32.png) [@mongesh\_madhavan](https://discuss.elastic.co/u/mongesh_madhavan)
#### Post date: [June 9, 2017, 3:37pm UTC](https://discuss.elastic.co/t/how-to-exclude-specific-child-document/88859/1 "2017-06-09T15:37:15Z")

</div>

Hi All,

I have situation where i want to search within selected child document. like if Parent has four nested objects, and i write language.hid=1051 then only that document should be searched along with parent data.

Tried using filter but then other things are not searchable like this  
{"query":{"bool":{"must":[{"match":{"firstName":{"query":"Rajesh"}}}],  
"filter":[{"match":{"language.healthSystemID":{"query":"68"}}}]  
}}}

I am using ES 2.X

My schema is like this  
{  
"id": 6,  
"FirstName" : "rajesh",  
"pattrib": [  
{  
"desc": "kutta",  
"hId": 1051  
},  
{  
"desc": "kamina",  
"hId": 1068  
},  
{  
"desc": "base kutta"  
}  
],  
"language": [  
{  
"name": "English",  
"hId": 1051  
},  
{  
"name": "Hindi",  
"hId": 1068  
},  
{  
"name": "null language"  
}  
]  
},

{  
"id": 7,  
"FirstName" : "rajesh",  
"pattrib": [  
{  
"desc": "suwar",  
"hId": 1051  
},  
{  
"desc": "base suwariya"  
}  
],  
"language": [  
{  
"name": "dufus",  
"hId": 1051  
},  
{  
"name": "background null"  
}  
]  
}  
}

---

<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 7, 2017, 3:37pm UTC](https://discuss.elastic.co/t/how-to-exclude-specific-child-document/88859/2 "2017-07-07T15:37:34Z")

</div>

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