# Why Elastic search need to reindex the entire document when there is a change in the mapping for one field?

**URL:** <https://discuss.elastic.co/t/why-elastic-search-need-to-reindex-the-entire-document-when-there-is-a-change-in-the-mapping-for-one-field/103761>\
**Category:** Elasticsearch\
**Created:** [October 12, 2017, 4:02pm UTC](https://discuss.elastic.co/t/why-elastic-search-need-to-reindex-the-entire-document-when-there-is-a-change-in-the-mapping-for-one-field/103761 "2017-10-12T16:02:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kant\_kodali](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kant_kodali/32/50637_2.png) [@kant\_kodali](https://discuss.elastic.co/u/kant_kodali)\
**Post date:** [October 12, 2017, 4:02pm UTC](https://discuss.elastic.co/t/why-elastic-search-need-to-reindex-the-entire-document-when-there-is-a-change-in-the-mapping-for-one-field/103761/1 "2017-10-12T16:02:30Z")

</div>

Why Elastic search need to reindex the entire document when there is a change in the mapping for one field?

It sounds to me that whenever there is change in the mapping (doesn't matter if it is one or few fields) ES will reindex the entire dataset (i.e it reindexes all documents and all fields that are available in a cluster). If I have change of mapping in one field why not reindex just that one field? Given ES uses inverted index data structure It looks to me that should be straight forward to do. am I totally wrong?

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [October 22, 2017, 11:48am UTC](https://discuss.elastic.co/t/why-elastic-search-need-to-reindex-the-entire-document-when-there-is-a-change-in-the-mapping-for-one-field/103761/2 "2017-10-22T11:48:46Z")

</div>

That happens because all these inverted indices together with the document sources are stored together in [immutable segments](https://www.elastic.co/blog/found-elasticsearch-from-the-bottom-up#index-segments). This immutability is used in many places to our advantage. While ability to change a field without re-indexing an entire document would have been beneficial, it would have also complicated a lot of things and slowed things down.

---

<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:** [November 19, 2017, 11:48am UTC](https://discuss.elastic.co/t/why-elastic-search-need-to-reindex-the-entire-document-when-there-is-a-change-in-the-mapping-for-one-field/103761/3 "2017-11-19T11:48:59Z")

</div>

Closed on November 19, 2017, 11:48am UTC

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