# Updating a mapping in existing indicese

**URL:** <https://discuss.elastic.co/t/updating-a-mapping-in-existing-indicese/294918>\
**Category:** Elasticsearch\
**Created:** [January 20, 2022, 9:21am UTC](https://discuss.elastic.co/t/updating-a-mapping-in-existing-indicese/294918 "2022-01-20T09:21:34Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Tomo\_M](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@Tomo\_M](https://discuss.elastic.co/u/Tomo_M)\
**Post date:** [January 20, 2022, 11:14am UTC](https://discuss.elastic.co/t/updating-a-mapping-in-existing-indicese/294918/7 "2022-01-20T11:14:42Z")

</div>

Yes, the code works but only if the SalaryPerYear does not exist yet in the mappings.

You can update the mappings when you only add new fields (including alias field), but it is impossible to change existing fields mappings or delete existing fields.

---

_[View the full topic](https://discuss.elastic.co/t/updating-a-mapping-in-existing-indicese/294918)._
