# Using \_reindex to convert a string field to a float

**URL:** <https://discuss.elastic.co/t/using-reindex-to-convert-a-string-field-to-a-float/268284>\
**Category:** Elasticsearch\
**Tags:** reindex\
**Created:** [March 25, 2021, 1:55am UTC](https://discuss.elastic.co/t/using-reindex-to-convert-a-string-field-to-a-float/268284 "2021-03-25T01:55:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![drdwilcox](https://avatars.discourse-cdn.com/v4/letter/d/7993a0/32.png) [@drdwilcox](https://discuss.elastic.co/u/drdwilcox)\
**Post date:** [March 25, 2021, 1:55am UTC](https://discuss.elastic.co/t/using-reindex-to-convert-a-string-field-to-a-float/268284/1 "2021-03-25T01:55:46Z")

</div>

The subject says it all. I have a field that is intermittently being saved in an index as:

```auto
{
  "index_with_string" : {
    "mappings" : {
      "timeElapsed" : {
        "full_name" : "timeElapsed",
        "mapping" : {
          "timeElapsed" : {
            "type" : "text",
            "fields" : {
              "keyword" : {
                "type" : "keyword",
                "ignore_above" : 256
              }
            }
          }
        }
      }
    }
  }
}

```

I would like mapped thus:

```auto
{
  "index_with_float" : {
   "mappings" : {
      "timeElapsed" : {
        "full_name" : "timeElapsed",
        "mapping" : {
          "timeElapsed" : {
            "type" : "float"
          }
        }
      }
    }
  }
}

```

I tried the following convert pipeline:

```auto
{
  "description": "converts the field timeElapsed to a float from a string",
  "processors" : [
    {
      "convert" : {
        "field" : "timeElapsed",
        "type": "float"
      }
    }
  ]
}

```

But I got invalid mapping errors with the error: "field [timeElapsed] not present as part of path [timeElapsed]" when I ran \_reindex.

Can anyone help me with the correct convert pipeline?

Thank you.

---

<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:** [April 22, 2021, 1:56am UTC](https://discuss.elastic.co/t/using-reindex-to-convert-a-string-field-to-a-float/268284/2 "2021-04-22T01:56:41Z")

</div>

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