# Reindex, convert float to float, mapper \[variableX\] cannot be changed from type \[float\] to \[long\]

**URL:** <https://discuss.elastic.co/t/reindex-convert-float-to-float-mapper-variablex-cannot-be-changed-from-type-float-to-long/237123>\
**Category:** Elasticsearch\
**Created:** [June 15, 2020, 11:35am UTC](https://discuss.elastic.co/t/reindex-convert-float-to-float-mapper-variablex-cannot-be-changed-from-type-float-to-long/237123 "2020-06-15T11:35:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![defalt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/defalt/32/71379_2.png) [@defalt](https://discuss.elastic.co/u/defalt)\
**Post date:** [June 15, 2020, 11:35am UTC](https://discuss.elastic.co/t/reindex-convert-float-to-float-mapper-variablex-cannot-be-changed-from-type-float-to-long/237123/1 "2020-06-15T11:35:26Z")

</div>

Hi,  
I am trying to reindex something. It works with 4/5 of my indcies but the last one fails because of:

```auto
{
    "took": 4178,
    "timed_out": false,
    "total": 56576151,
    "updated": 0,
    "created": 994,
    "deleted": 0,
    "batches": 1,
    "version_conflicts": 0,
    "noops": 0,
    "retries": {
        "bulk": 0,
        "search": 0
    },
    "throttled_millis": 0,
    "requests_per_second": -1.0,
    "throttled_until_millis": 0,
    "failures": [
        {
            "index": "index_new",
            "type": "specific_Variable",
            "id": "AW0NVRx9LYYiXtYaus-y",
            "cause": {
                "type": "illegal_argument_exception",
                "reason": "mapper [variableX] cannot be changed from type [float] to [long]"
            },
            "status": 400
        },
        {
            "index": "index_new",
            "type": "variable",
            "id": "AWxaFbxRFrqdVWDKqXmd",
            "cause": {
                "type": "illegal_argument_exception",
                "reason": "mapper [variableY] cannot be changed from type [float] to [long]"
            },
            "status": 400
        },
        .
.
// Happens another 3 times with other variables
.

    ]
}

```

My Command:

```auto
POST /_reindex
{
  "conflicts": "proceed",
  "source": {
    "index": "index"
  },
  "dest": {
    "index": "index_new",
    "op_type": "create"
  }
}

```

I tried it with a processor but it didn't help.

```auto
{
  "conflicts": "proceed",
  "source": {
    "index": "index"
  },
  "processors" : [
    {
      "convert" : {
        "field" : "variableX",
        "type": "float"
      }
    }
  ],
  "dest": {
    "index": "index_new",
    "op_type": "create"
  }
}

```

Any ideas?  
Thanks

---

<div class="post-metadata">

**Author:** ![defalt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/defalt/32/71379_2.png) [@defalt](https://discuss.elastic.co/u/defalt)\
**Post date:** [June 15, 2020, 2:13pm UTC](https://discuss.elastic.co/t/reindex-convert-float-to-float-mapper-variablex-cannot-be-changed-from-type-float-to-long/237123/2 "2020-06-15T14:13:58Z")

</div>

Solved by creating a mapping for the 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:** [July 13, 2020, 2:14pm UTC](https://discuss.elastic.co/t/reindex-convert-float-to-float-mapper-variablex-cannot-be-changed-from-type-float-to-long/237123/3 "2020-07-13T14:14:04Z")

</div>

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