# Change the type of a field

**URL:** <https://discuss.elastic.co/t/change-the-type-of-a-field/71861>\
**Category:** Elasticsearch\
**Created:** [January 17, 2017, 1:08pm UTC](https://discuss.elastic.co/t/change-the-type-of-a-field/71861 "2017-01-17T13:08:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rdesgrange](https://avatars.discourse-cdn.com/v4/letter/r/a5b964/32.png) [@rdesgrange](https://discuss.elastic.co/u/rdesgrange)\
**Post date:** [January 17, 2017, 1:08pm UTC](https://discuss.elastic.co/t/change-the-type-of-a-field/71861/1 "2017-01-17T13:08:44Z")

</div>

Hi everyone,

I have an ELK stack, up and running. Logstash ingest log perfectly but, I forgot something when I did a grok pattern, and I have a list of field that are consider string, but really they are float. I have approx 1To of data. My question is how can I change the type of this field ? I think I need to re-index. But I'm not sure how ? Is doing it with `reindex`method with elasticsearch-py help ? Can I do it like that :

- take `logstash-{DATE}`, re-index in `logstash-{DATE}-reindex` with the correct field type
- once done suppress `logstash-{DATE}`
- reindex from `logstash-{DATE}-reindex`to `logstash-{DATE}`

In advance thanks

---

<div class="post-metadata">

**Author:** ![JKhondhu](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@JKhondhu](https://discuss.elastic.co/u/JKhondhu)\
**Post date:** [January 17, 2017, 4:42pm UTC](https://discuss.elastic.co/t/change-the-type-of-a-field/71861/2 "2017-01-17T16:42:31Z")

</div>

- Take logstash-{DATE}, re-index in logstash-{DATE}-reindex with the correct field type
- Once done suppress logstash-{DATE}
- Reindex from logstash-{DATE}-reindexto logstash-{DATE}

If you require the addition of a new field value and you want to close the older (missing field) index, you will need to index. Correct. For reference: [https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html)

---

<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:** [February 14, 2017, 4:42pm UTC](https://discuss.elastic.co/t/change-the-type-of-a-field/71861/3 "2017-02-14T16:42:31Z")

</div>

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