# Adding new field to the mapping template

**URL:** https://discuss.elastic.co/t/adding-new-field-to-the-mapping-template/249102
**Category:** Elasticsearch
**Created:** [September 18, 2020, 1:00pm UTC](https://discuss.elastic.co/t/adding-new-field-to-the-mapping-template/249102 "2020-09-18T13:00:49Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![YvorL](https://avatars.discourse-cdn.com/v4/letter/y/9fc348/32.png) [@YvorL](https://discuss.elastic.co/u/YvorL)
#### Post date: [September 18, 2020, 1:00pm UTC](https://discuss.elastic.co/t/adding-new-field-to-the-mapping-template/249102/1 "2020-09-18T13:00:49Z")

</div>

Hi,

From time to time, I need to add a new field to my templates (mostly daily indices). Is there an easy way to apply that to an existing index?

Thank you!

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [September 21, 2020, 12:02pm UTC](https://discuss.elastic.co/t/adding-new-field-to-the-mapping-template/249102/2 "2020-09-21T12:02:34Z")

</div>

You can apply a new field to your existing index in the mapping first, but still need to do a reindex of each document. You can use the [update by query API](https://www.elastic.co/guide/en/elasticsearch/reference/7.8/docs-update-by-query.html) to reindex every document within its index...

---

<div class="post-metadata">

### Author: ![YvorL](https://avatars.discourse-cdn.com/v4/letter/y/9fc348/32.png) [@YvorL](https://discuss.elastic.co/u/YvorL)
#### Post date: [September 21, 2020, 9:22pm UTC](https://discuss.elastic.co/t/adding-new-field-to-the-mapping-template/249102/3 "2020-09-21T21:22:49Z")

</div>

Thank you for clarifying this. Could you answer two related question?  
If I run update by query, will it affect the size of the index? Also, if the index is actively written, can I run an update on it, or I need to wait until the new one is opened?

---

<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: [October 19, 2020, 9:22pm UTC](https://discuss.elastic.co/t/adding-new-field-to-the-mapping-template/249102/4 "2020-10-19T21:22:55Z")

</div>

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