# Nested and Parent/Child

**URL:** <https://discuss.elastic.co/t/nested-and-parent-child/9474>\
**Category:** Elasticsearch\
**Created:** [October 25, 2012, 7:38pm UTC](https://discuss.elastic.co/t/nested-and-parent-child/9474 "2012-10-25T19:38:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@Mike](https://discuss.elastic.co/u/Mike)\
**Post date:** [October 25, 2012, 7:38pm UTC](https://discuss.elastic.co/t/nested-and-parent-child/9474/1 "2012-10-25T19:38:35Z")

</div>

1. Is the only benefit of nested types that it's more performant than  
parent/child since you have the full relationship at index time? If not,  
what other benefits does the nested block join provide over it?

2. Does parent/child solve the "cross object" false positives that  
nested types do?  
[http://www.elasticsearch.org/guide/reference/mapping/nested-type.html](http://www.elasticsearch.org/guide/reference/mapping/nested-type.html)

3. Is parent/child equivalent to the query time join released in Solr  
4.0?

--

---

<div class="post-metadata">

**Author:** ![radu\_gheorghe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/radu_gheorghe/32/556_2.png) [@radu\_gheorghe](https://discuss.elastic.co/u/radu_gheorghe)\
**Post date:** [October 25, 2012, 9:50pm UTC](https://discuss.elastic.co/t/nested-and-parent-child/9474/2 "2012-10-25T21:50:57Z")

</div>

Hello Mike,

On Thu, Oct 25, 2012 at 10:38 PM, Mike [mnilsson2323@gmail.com](mailto:mnilsson2323@gmail.com) wrote:

> Is the only benefit of nested types that it's more performant than  
> parent/child since you have the full relationship at index time? If not,  
> what other benefits does the nested block join provide over it?

They should perform better when the components are joined, yes.  
Although I haven't specifically tested that. Maybe someone else can  
bring some "hard data".

With nested docs it's easy to get the whole document that matches a  
certain query. And it's easier to do queries and facets when you need  
values from different "levels". For example, by default when you  
search in "\_all" you get results from everywhere.

> Does parent/child solve the "cross object" false positives that nested types  
> do?  
> [Elastic — The Search AI Company | Elastic](http://www.elasticsearch.org/guide/reference/mapping/nested-type.html)

Yes, you shouldn't get such cross-references.

> Is parent/child equivalent to the query time join released in Solr 4.0?

They seem pretty similar, indeed, although there are some differences.  
Here's what I see:

- in Elasticsearch you define the relationship in the mapping, while  
in Solr you do it at query-time. That should make the ES approach  
faster and the Solr approach more flexible
- in ES, a parent and its children rely on the same shard
- in Solr, a "child" may have multiple "parents"

## Best regards, Radu

[http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene

--

---

<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, 3:07am UTC](https://discuss.elastic.co/t/nested-and-parent-child/9474/3 "2017-07-06T03:07:09Z")

</div>


