# Filter on 2 child documents possible?

**URL:** https://discuss.elastic.co/t/filter-on-2-child-documents-possible/12848
**Category:** Elasticsearch
**Created:** [July 18, 2013, 6:47pm UTC](https://discuss.elastic.co/t/filter-on-2-child-documents-possible/12848 "2013-07-18T18:47:08Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![robertmattler](https://avatars.discourse-cdn.com/v4/letter/r/f4b2a3/32.png) [@robertmattler](https://discuss.elastic.co/u/robertmattler)
#### Post date: [July 18, 2013, 6:47pm UTC](https://discuss.elastic.co/t/filter-on-2-child-documents-possible/12848/1 "2013-07-18T18:47:08Z")

</div>

I'm trying to filter to 2 child documents. Is this possible?

{  
"size" : 51,  
"filter" : {  
"and" : {  
"filters" : [ {  
"has\_child" : {  
"filter" : {  
"terms" : {  
"identifier\_type" : ["aaa", "bbb", "ccc", "ddd", "eee"]  
}  
},  
"child\_type" : "source\_patient\_id"  
}  
}, {  
"has\_child" : {  
"filter" : {  
"query" : {  
"wildcard" : {  
"identifier\_value" : "_123456789_"  
}  
}  
},  
"child\_type" : "source\_patient\_id"  
}  
}, {  
"has\_child" : {  
"filter" : {  
"or" : {  
"filters" : [ {  
"term" : {  
"providers" : 300  
}  
} ]  
}  
},  
"child\_type" : "providers"  
}  
} ]  
}  
}  
}

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:25am UTC](https://discuss.elastic.co/t/filter-on-2-child-documents-possible/12848/2 "2017-07-06T02:25:39Z")

</div>


