# Update index with static value instead of scripted field

**URL:** https://discuss.elastic.co/t/update-index-with-static-value-instead-of-scripted-field/263890
**Category:** Elasticsearch
**Created:** [February 10, 2021, 3:40pm UTC](https://discuss.elastic.co/t/update-index-with-static-value-instead-of-scripted-field/263890 "2021-02-10T15:40:51Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![stevezemlicka](https://avatars.discourse-cdn.com/v4/letter/s/41988e/32.png) [@stevezemlicka](https://discuss.elastic.co/u/stevezemlicka)
#### Post date: [February 10, 2021, 4:45pm UTC](https://discuss.elastic.co/t/update-index-with-static-value-instead-of-scripted-field/263890/3 "2021-02-10T16:45:49Z")

</div>

I might not have done enough research on this before posting...perhaps the answer is in something like:

> [@Reindex data with a new Field](https://discuss.elastic.co/t/reindex-data-with-a-new-field/115073):
>
> Hi, Is there anyway to reindex the data and create a new field, from the data in the documents. For example, reindex an entire index and create a new field Hour(number) from a date type field(YYYY-mm-dd, HH-mm-ss). I Know that Lucene has an expresion for this(doc['@timestamp'].date.getHourOfDay()), but can this be used to create a new field when you reindex? I need this new field for a search query and the scripted fields can't be used for this, the alternative is using a script on the query …

---

_[View the full topic](https://discuss.elastic.co/t/update-index-with-static-value-instead-of-scripted-field/263890)._
