# Find all parents by parent and child search

**URL:** <https://discuss.elastic.co/t/find-all-parents-by-parent-and-child-search/49218>\
**Category:** Elasticsearch\
**Created:** [May 4, 2016, 7:15pm UTC](https://discuss.elastic.co/t/find-all-parents-by-parent-and-child-search/49218 "2016-05-04T19:15:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_M](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@John\_M](https://discuss.elastic.co/u/John_M)\
**Post date:** [May 4, 2016, 7:15pm UTC](https://discuss.elastic.co/t/find-all-parents-by-parent-and-child-search/49218/1 "2016-05-04T19:15:04Z")

</div>

I'm new to Elasticserch and I'm looking for a way to find all parents base on a query but also bring up parents based on their children.

```
Example: 
Parent records
    ID Text       
    1 bob        
    2 john       
    3 bobby    

Child Records
    ID ParentID Text            
    11 1 phone        
    22 2 bob             
    33 3 green

```

I want to search "bob" and find all 3 parent records.  
Parent ID 2 will come up in results based on Child 22 Text "bob"

Is this possible?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 5, 2016, 7:48am UTC](https://discuss.elastic.co/t/find-all-parents-by-parent-and-child-search/49218/2 "2016-05-05T07:48:23Z")

</div>

So you want to find both parent and children with `bob` in them?

---

<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, 10:53pm UTC](https://discuss.elastic.co/t/find-all-parents-by-parent-and-child-search/49218/3 "2017-07-05T22:53:49Z")

</div>


