# Search for a parent or child

**URL:** https://discuss.elastic.co/t/search-for-a-parent-or-child/201914
**Category:** Elasticsearch
**Created:** [October 2, 2019, 8:58am UTC](https://discuss.elastic.co/t/search-for-a-parent-or-child/201914 "2019-10-02T08:58:28Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![NEkman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nekman/32/55241_2.png) [@NEkman](https://discuss.elastic.co/u/NEkman)
#### Post date: [October 2, 2019, 8:58am UTC](https://discuss.elastic.co/t/search-for-a-parent-or-child/201914/1 "2019-10-02T08:58:28Z")

</div>

We are investigating splitting nested documents up into parent/child documents.

I'm wondering, how can we query/search for a document of a specific type? E.g. we index questions and answers, and want to be able to efficiently search for questions or answers regardless of the relationship.

We don't want to invest into `_type` since it's being deprecated and removed. `has_child`/`has_parent` queries have performance warnings about using them in the docs. What is the correct way to achieve this?

---

<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: [October 30, 2019, 8:58am UTC](https://discuss.elastic.co/t/search-for-a-parent-or-child/201914/2 "2019-10-30T08:58:30Z")

</div>

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