# How to change field from text, float to only float?

**URL:** <https://discuss.elastic.co/t/how-to-change-field-from-text-float-to-only-float/346958>\
**Category:** Elasticsearch\
**Created:** [November 13, 2023, 7:13am UTC](https://discuss.elastic.co/t/how-to-change-field-from-text-float-to-only-float/346958 "2023-11-13T07:13:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![randomnamegenerator](https://avatars.discourse-cdn.com/v4/letter/r/7ab992/32.png) [@randomnamegenerator](https://discuss.elastic.co/u/randomnamegenerator)\
**Post date:** [November 13, 2023, 7:13am UTC](https://discuss.elastic.co/t/how-to-change-field-from-text-float-to-only-float/346958/1 "2023-11-13T07:13:58Z")

</div>

Hello there,

We have an issue on one of our customer sites where a field is mapped as text, float rather than just float. I believe this is causing a grok timeout issue.

The ELK stack is receiving logs from an application and creates a new index each day.

Our in-house setup (same ELK stack version) detects and maps this field as just float and does not have this grok timeout issue. Please see screenshots below

Customer site

```auto
},
        "spend_time": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }

```

In-house test VM

```auto
 },
        "spend_time": {
          "type": "float"
        },

```

Question, am I able to override this by creating a new field in the index template gui as below?

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/e/f/ef10db82fe93251eb18a5f49b45d4209f7d15718.png)

Thanks in advance

---

<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:** [November 13, 2023, 9:20am UTC](https://discuss.elastic.co/t/how-to-change-field-from-text-float-to-only-float/346958/2 "2023-11-13T09:20:51Z")

</div>

Yes. If you specify in the index mapping or in the index template what must be the data type for this field, then Elasticsearch will not try to guess anymore.

---

<div class="post-metadata">

**Author:** ![randomnamegenerator](https://avatars.discourse-cdn.com/v4/letter/r/7ab992/32.png) [@randomnamegenerator](https://discuss.elastic.co/u/randomnamegenerator)\
**Post date:** [November 13, 2023, 9:25am UTC](https://discuss.elastic.co/t/how-to-change-field-from-text-float-to-only-float/346958/3 "2023-11-13T09:25:41Z")

</div>

Great,

So this would mean that going forward every document index the field as float,

If I reindex this would also apply the field value from the index template to the existing indexes ?

---

<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:** [November 13, 2023, 10:01am UTC](https://discuss.elastic.co/t/how-to-change-field-from-text-float-to-only-float/346958/4 "2023-11-13T10:01:11Z")

</div>

Yes. As long it creates a new index with the new field type, that will be ok.

---

<div class="post-metadata">

**Author:** ![randomnamegenerator](https://avatars.discourse-cdn.com/v4/letter/r/7ab992/32.png) [@randomnamegenerator](https://discuss.elastic.co/u/randomnamegenerator)\
**Post date:** [November 15, 2023, 8:52am UTC](https://discuss.elastic.co/t/how-to-change-field-from-text-float-to-only-float/346958/5 "2023-11-15T08:52:12Z")

</div>

will adding a field to the mapping section of the index template affect the other fields that are being dynamically mapped or the will be index as before?

---

<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:** [December 13, 2023, 8:52am UTC](https://discuss.elastic.co/t/how-to-change-field-from-text-float-to-only-float/346958/6 "2023-12-13T08:52:44Z")

</div>

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