# Index Mapping- Update API

**URL:** <https://discuss.elastic.co/t/index-mapping-update-api/265515>\
**Category:** Elasticsearch\
**Created:** [February 25, 2021, 4:45pm UTC](https://discuss.elastic.co/t/index-mapping-update-api/265515 "2021-02-25T16:45:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![leemase004](https://avatars.discourse-cdn.com/v4/letter/l/fbc32d/32.png) [@leemase004](https://discuss.elastic.co/u/leemase004)\
**Post date:** [February 25, 2021, 4:45pm UTC](https://discuss.elastic.co/t/index-mapping-update-api/265515/1 "2021-02-25T16:45:03Z")

</div>

We found an error in our index mapping and have successfully fixed the issue- all future indices will have the correct mapping; however, we are now looking to go back and fix all the old indices that have the incorrect mapping (they keep throwing shard errors when a queries are run)

The incorrect mappings on the old indices are ~2k lines long.  
The correct mappings show ~5k lines.

Ive seen the update API for index mappings but that only shows a few stanzas at a time. Whats the best way to handle an index mapping update when it has to deal with this many lines? It also appears this update will need to be made to a lot of indices so any help on how to tackled multiple indices at once would help as well.

---

<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:** [February 25, 2021, 11:04pm UTC](https://discuss.elastic.co/t/index-mapping-update-api/265515/2 "2021-02-25T23:04:30Z")

</div>

Are you just looking to update the mapping, or to reindex?

---

<div class="post-metadata">

**Author:** ![leemase004](https://avatars.discourse-cdn.com/v4/letter/l/fbc32d/32.png) [@leemase004](https://discuss.elastic.co/u/leemase004)\
**Post date:** [February 26, 2021, 2:42am UTC](https://discuss.elastic.co/t/index-mapping-update-api/265515/3 "2021-02-26T02:42:32Z")

</div>

Would we need to re-index???  
(The correct mapping has dynamic templates set and has the appropriate fields labeled as keyword so data can be aggregated)

What benefits would there be if we updated the mappings, but didn’t re-index?

What benefits would there be if we updated mapping and also reindexed?

---

<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:** [March 26, 2021, 2:42am UTC](https://discuss.elastic.co/t/index-mapping-update-api/265515/4 "2021-03-26T02:42:58Z")

</div>

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