# How to get parent with ALL children by search query(parent-child)

**URL:** <https://discuss.elastic.co/t/how-to-get-parent-with-all-children-by-search-query-parent-child/55672>\
**Category:** Elasticsearch\
**Created:** [July 16, 2016, 5:03pm UTC](https://discuss.elastic.co/t/how-to-get-parent-with-all-children-by-search-query-parent-child/55672 "2016-07-16T17:03:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![moren](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@moren](https://discuss.elastic.co/u/moren)\
**Post date:** [July 16, 2016, 5:03pm UTC](https://discuss.elastic.co/t/how-to-get-parent-with-all-children-by-search-query-parent-child/55672/1 "2016-07-16T17:03:24Z")

</div>

Hi! I have person-company relation here (Person has many companies). When I make search request for a person who have companies with name "example", elastic responds with a person and only child companies which have their names matched. But I want to get all companies, except companies which have matches to get higher score.

---

<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:35pm UTC](https://discuss.elastic.co/t/how-to-get-parent-with-all-children-by-search-query-parent-child/55672/2 "2017-07-05T22:35:02Z")

</div>

Closed on July 5, 2017, 10:35pm UTC


