# Create new field in ES and backfill it with data

**URL:** https://discuss.elastic.co/t/create-new-field-in-es-and-backfill-it-with-data/104314
**Category:** Elasticsearch
**Created:** [October 17, 2017, 11:05pm UTC](https://discuss.elastic.co/t/create-new-field-in-es-and-backfill-it-with-data/104314 "2017-10-17T23:05:58Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Natalia\_Kuleniuk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/natalia_kuleniuk/32/43727_2.png) [@Natalia\_Kuleniuk](https://discuss.elastic.co/u/Natalia_Kuleniuk)
#### Post date: [October 17, 2017, 11:05pm UTC](https://discuss.elastic.co/t/create-new-field-in-es-and-backfill-it-with-data/104314/1 "2017-10-17T23:05:58Z")

</div>

We have ElasticSearch index that stores large dataset. I need to add two new fields to ES index and backfill values for these fields from Redshift. My question is how can I achieve this? What is the best approach: change existed ES scheme by adding 2 new fields or create new index with all needed fields. I am new to ES, so any suggestions, ideas will be helpful.

---

<div class="post-metadata">

### Author: ![mujtabahussain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mujtabahussain/32/17514_2.png) [@mujtabahussain](https://discuss.elastic.co/u/mujtabahussain)
#### Post date: [October 17, 2017, 11:24pm UTC](https://discuss.elastic.co/t/create-new-field-in-es-and-backfill-it-with-data/104314/2 "2017-10-17T23:24:20Z")

</div>

Lets say you have the two new fields `x` and `y` and each document in the current index had the id `ID`. If you added `x` and `y` to the current index, could you match backfilled values to their relevant ids?

---

<div class="post-metadata">

### Author: ![Natalia\_Kuleniuk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/natalia_kuleniuk/32/43727_2.png) [@Natalia\_Kuleniuk](https://discuss.elastic.co/u/Natalia_Kuleniuk)
#### Post date: [October 17, 2017, 11:41pm UTC](https://discuss.elastic.co/t/create-new-field-in-es-and-backfill-it-with-data/104314/3 "2017-10-17T23:41:09Z")

</div>

Yes, I thought I can be able to match them. My ElasticSearch has , for example, 2 fields:"A", "B". I would like to add two more fields "C" and "D".  
My Redshift table has fields "A", "C" and "D". So I want to copy fields "C" and "D" from Redshift to ES. Both Redshift and ES have "A" field in common.

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [October 18, 2017, 6:19am UTC](https://discuss.elastic.co/t/create-new-field-in-es-and-backfill-it-with-data/104314/4 "2017-10-18T06:19:50Z")

</div>

You need to reindex. And because you need to reindex all I’d recommend reindexing in a new index.

If you are using aliases which is a good practice, just switch the alias to the new index and drop the old index.

---

<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 15, 2017, 3:37pm UTC](https://discuss.elastic.co/t/create-new-field-in-es-and-backfill-it-with-data/104314/6 "2017-11-15T15:37:05Z")

</div>

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