# Updating Root Document & Nested Document Behaviour

**URL:** <https://discuss.elastic.co/t/updating-root-document-nested-document-behaviour/31354>\
**Category:** Elasticsearch\
**Created:** [September 29, 2015, 5:09pm UTC](https://discuss.elastic.co/t/updating-root-document-nested-document-behaviour/31354 "2015-09-29T17:09:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![CraigL](https://avatars.discourse-cdn.com/v4/letter/c/e9c0ed/32.png) [@CraigL](https://discuss.elastic.co/u/CraigL)\
**Post date:** [September 29, 2015, 5:09pm UTC](https://discuss.elastic.co/t/updating-root-document-nested-document-behaviour/31354/1 "2015-09-29T17:09:08Z")

</div>

I've read in many places that updating nested documents will cause a reindex of the parent document.

But what I'm not clear on is if updating the parent document will cause a reindex of all the nested documents. It sounds like ES stores them as separate docs under the covers, and if the nested documents don't copy their fields to the parent "\_all" or "\_source", I think it won't need to reindex them?

What we're thinking about doing is moving our very large fields into nested documents, and have the more frequently changing fields in the root/parent document. We need this as we are way, way too often hitting the merge throttling limit, which just seems to shut down indexing completely.

Thanks,

CraigL

---

<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:** [September 30, 2015, 9:51am UTC](https://discuss.elastic.co/t/updating-root-document-nested-document-behaviour/31354/2 "2015-09-30T09:51:42Z")

</div>

Nesting is just a single document and there is no "parent document" that is separate. So yes, updating anything means that the entire document needs to be reindexed.

Parent/child has separate documents for each though, is that what you mean?.

---

<div class="post-metadata">

**Author:** ![CraigL](https://avatars.discourse-cdn.com/v4/letter/c/e9c0ed/32.png) [@CraigL](https://discuss.elastic.co/u/CraigL)\
**Post date:** [September 30, 2015, 5:26pm UTC](https://discuss.elastic.co/t/updating-root-document-nested-document-behaviour/31354/3 "2015-09-30T17:26:31Z")

</div>

> [@warkolm](#):
>
> Nesting is just a single document and there is no "parent document" that is separate. So yes, updating anything means that the entire document needs to be reindexed.
> 
> Parent/child has separate documents for each though, is that what you mean?.

I was basing my comment on the documentation for Nested Types:

```
Internally, nested objects are indexed as additional documents,
but, since they can be guaranteed to be indexed within the same
"block", it allows for extremely fast joining with parent docs.

```

So, while I realize they're not accessible or "viewable" as separate docs, it sounded to me like I could update the "internal" parent document without needing to reindex the "internal" nested documents.

I'm doing some testing now with both types to see how it works. We just cannot roll out with the degree of merge throttling that occurs when the big fields in our index are constantly being reindexed.

CraigL

---

<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, 11:47pm UTC](https://discuss.elastic.co/t/updating-root-document-nested-document-behaviour/31354/4 "2017-07-05T23:47:20Z")

</div>


