# ES7 - how to model 1-n parent-child relations - different ES types

**URL:** https://discuss.elastic.co/t/es7-how-to-model-1-n-parent-child-relations-different-es-types/236792
**Category:** Elasticsearch
**Created:** [June 11, 2020, 10:01pm UTC](https://discuss.elastic.co/t/es7-how-to-model-1-n-parent-child-relations-different-es-types/236792 "2020-06-11T22:01:50Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![kcris](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kcris/32/70200_2.png) [@kcris](https://discuss.elastic.co/u/kcris)
#### Post date: [June 11, 2020, 10:01pm UTC](https://discuss.elastic.co/t/es7-how-to-model-1-n-parent-child-relations-different-es-types/236792/1 "2020-06-11T22:01:50Z")

</div>

Hi,

I am migrating an old ES instance to ES7. We need 1-n parent-child relations.

We used to have multiple types in the same index and it was easy. Some types were related to their parent via `_parent` .

But ES7 will only allow single-type indices. Which makes me think I will convert the old types to separate indices.

I read the docs and they suggest using `join` for parent-child relations, however those seem to apply only to documents belonging to a single index.

> **[Removal of mapping types in Elasticsearch 6.0](https://www.elastic.co/blog/removal-of-mapping-types-elasticsearch)**
>
> Mapping types are going away. Elasticsearch 6.0 supports a single mapping type per index only, and it represents the first step on the way to removing types altogether.

So if I convert my previous types to separate indices, in my understanding `join` will not help.

**So what is the right solution to model parent-child relation between different types (or should I say indices) in ES7?**

Or maybe I should not model my data as separate types/indices in ES7. But in that case, how to solve this?

Thanks

---

<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 9, 2020, 10:01pm UTC](https://discuss.elastic.co/t/es7-how-to-model-1-n-parent-child-relations-different-es-types/236792/2 "2020-07-09T22:01:55Z")

</div>

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