# Update mapping gives error

**URL:** https://discuss.elastic.co/t/update-mapping-gives-error/38880
**Category:** Elasticsearch
**Created:** [January 11, 2016, 1:16pm UTC](https://discuss.elastic.co/t/update-mapping-gives-error/38880 "2016-01-11T13:16:27Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![trushad](https://avatars.discourse-cdn.com/v4/letter/t/7cd45c/32.png) [@trushad](https://discuss.elastic.co/u/trushad)
#### Post date: [January 11, 2016, 1:16pm UTC](https://discuss.elastic.co/t/update-mapping-gives-error/38880/1 "2016-01-11T13:16:27Z")

</div>

I m getting merge\_mapping\_exception when I m updating mapping,

[http://localhost:9200/logstash/filedoc/\_mapping?ignore\_conflicts=true](http://localhost:9200/logstash/filedoc/_mapping?ignore_conflicts=true)

```
{
  "properties": {
    "id": {
      "type": "long"
    }
  }
}

{
  "logstash": {
    "aliases": {},
    "mappings": {
      "filedoc": {
        "properties": {
          "@timestamp": {
            "type": "date",
            "format": "strict_date_optional_time||epoch_millis"
          },
          "@version": {
            "type": "string"
          },
          "date": {
            "type": "date",
            "format": "yyyy/MM/dd HH:mm:ss||yyyy/MM/dd||epoch_millis"
          },
          "description": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "ignition": {
            "type": "string"
          },
          "lat": {
            "type": "string"
          },
          "long": {
            "type": "string"
          },
          "odometer": {
            "type": "string"
          },
          "reg": {
            "type": "string"
          },
          "speed": {
            "type": "string"
          },
          "time": {
            "type": "string"
          }
        }
      }
    }
>
```

---

<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: [January 11, 2016, 1:32pm UTC](https://discuss.elastic.co/t/update-mapping-gives-error/38880/2 "2016-01-11T13:32:23Z")

</div>

Hard to know exactly what you are doing here but it sounds like you are providing only `id` field in the PUT Mapping request.

Also you can't change a String to a number.

---

<div class="post-metadata">

### Author: ![trushad](https://avatars.discourse-cdn.com/v4/letter/t/7cd45c/32.png) [@trushad](https://discuss.elastic.co/u/trushad)
#### Post date: [January 12, 2016, 11:35am UTC](https://discuss.elastic.co/t/update-mapping-gives-error/38880/3 "2016-01-12T11:35:22Z")

</div>

If I want to change existing field type (here id) from string to long? Is it possible with mapping?  
If no? what are the ways to change existing field type to other type.

---

<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: [January 12, 2016, 2:34pm UTC](https://discuss.elastic.co/t/update-mapping-gives-error/38880/4 "2016-01-12T14:34:48Z")

</div>

You have to reindex.

You can read this: [http://david.pilato.fr/blog/2015/05/20/reindex-elasticsearch-with-logstash/](http://david.pilato.fr/blog/2015/05/20/reindex-elasticsearch-with-logstash/)

---

<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 5, 2017, 11:25pm UTC](https://discuss.elastic.co/t/update-mapping-gives-error/38880/5 "2017-07-05T23:25:11Z")

</div>


