# Is it possible to update an existing field in an index through mapping in Elasticsearch?

**URL:** https://discuss.elastic.co/t/is-it-possible-to-update-an-existing-field-in-an-index-through-mapping-in-elasticsearch/64510
**Category:** Elasticsearch
**Created:** [November 1, 2016, 4:37am UTC](https://discuss.elastic.co/t/is-it-possible-to-update-an-existing-field-in-an-index-through-mapping-in-elasticsearch/64510 "2016-11-01T04:37:48Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Kulasangar\_Gowrisang](https://avatars.discourse-cdn.com/v4/letter/k/ce73a5/32.png) [@Kulasangar\_Gowrisang](https://discuss.elastic.co/u/Kulasangar_Gowrisang)
#### Post date: [November 1, 2016, 4:37am UTC](https://discuss.elastic.co/t/is-it-possible-to-update-an-existing-field-in-an-index-through-mapping-in-elasticsearch/64510/1 "2016-11-01T04:37:48Z")

</div>

I've already created an index, and it contains data from my `MySQL` database. I've got few fields which are `string` in my table, where I need them as different types (`integer` & `double`) in `Elasticsearch`.

So I'm aware that I could do it through `mapping` as follows:

```
{
  "mappings": {
    "my_type": {
      "properties": {
        "userid": {
          "type": "text",
          "fielddata": true
        },
        "responsecode": {
          "type": "integer"
        },
        "chargeamount": {
          "type": "double"
        }
      }
    }
  }
} 

```

But I've tried this when I'm creating the index as a new one. What I wanted to know is how can I update an existing field (ie: `chargeamount` in this scenario) using `mapping` as a `PUT`?

Is this possible? Any help could be appreciated.

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [November 1, 2016, 4:38am UTC](https://discuss.elastic.co/t/is-it-possible-to-update-an-existing-field-in-an-index-through-mapping-in-elasticsearch/64510/2 "2016-11-01T04:38:21Z")

</div>

You cannot, you need to reindex.

---

<div class="post-metadata">

### Author: ![Kulasangar\_Gowrisang](https://avatars.discourse-cdn.com/v4/letter/k/ce73a5/32.png) [@Kulasangar\_Gowrisang](https://discuss.elastic.co/u/Kulasangar_Gowrisang)
#### Post date: [November 1, 2016, 4:38am UTC](https://discuss.elastic.co/t/is-it-possible-to-update-an-existing-field-in-an-index-through-mapping-in-elasticsearch/64510/3 "2016-11-01T04:38:50Z")

</div>

@warkolm thanks 🙂

---

<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, 10:08pm UTC](https://discuss.elastic.co/t/is-it-possible-to-update-an-existing-field-in-an-index-through-mapping-in-elasticsearch/64510/4 "2017-07-05T22:08:01Z")

</div>


