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

(Kulasangar Gowrisangar) #1

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.

(Mark Walkom) #2

You cannot, you need to reindex.

(Kulasangar Gowrisangar) #3

@warkolm thanks :slight_smile:

(system) #4