# Mapping Problem while Update Mapping in existing index

**URL:** <https://discuss.elastic.co/t/mapping-problem-while-update-mapping-in-existing-index/52858>\
**Category:** Elasticsearch\
**Created:** [June 15, 2016, 12:22pm UTC](https://discuss.elastic.co/t/mapping-problem-while-update-mapping-in-existing-index/52858 "2016-06-15T12:22:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rajkumar\_E](https://avatars.discourse-cdn.com/v4/letter/r/9de053/32.png) [@Rajkumar\_E](https://discuss.elastic.co/u/Rajkumar_E)\
**Post date:** [June 15, 2016, 12:22pm UTC](https://discuss.elastic.co/t/mapping-problem-while-update-mapping-in-existing-index/52858/1 "2016-06-15T12:22:40Z")

</div>

I am working on EFK , I pushed mysql data to elasticsearch. I need to update mapping for existing index.

This is Mapping Value:

```
     {
        "chatdemo3": {
          "mappings": {
            "chatdemoc": {
              "properties": {
                "active": {
                  "type": "string"
                },
                "chat_from": {
                  "type": "string"
                },
                "chat_to": {
                  "type": "string"
                },
                "deactive": {
                  "type": "string"
                },
                "id": {
                  "type": "long"
                },
                "ip": {
                  "type": "string"
                },
                "mail": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "socketid": {
                  "type": "string"
                },
                "timedate": {
                  "type": "string"
                }
              }
            }
          }
        }
      }

```

I follow this link: [https://gist.github.com/nicolashery/6317643](https://gist.github.com/nicolashery/6317643) to update mapping for existing index its throw error.

I need add **"index": "not\_analyzed"**

so i try to update myindex mapping in CMD:

```
       $ curl-XPUT'http://localhost:9200/chatdemo3/chatdemoc/_mapping?ignore_conflicts=true'-d'\' '{
          "chatdemo3": {
            "mappings": {
              "chatdemoc": {
                "properties": {
                  "active": {
                    "type": "string"
                  },
                  "chat_from": {
                    "type": "string"
                  },
                  "chat_to": {
                    "type": "string"
                  },
                  "deactive": {
                    "type": "string"
                  },
                  "id": {
                    "type": "long"
                  },
                  "ip": {
                    "type": "string"
                  },
                  "mail": {
                    "type": "string",
                    "index": "not_analyzed"
                  },
                  "message": {
                    "type": "string",
                    "index": "not_analyzed"
                  },
                  "name": {
                    "type": "string",
                    "index": "not_analyzed"
                  },
                  "reason": {
                    "type": "string",
                    "index": "not_analyzed"
                  },
                  "socketid": {
                    "type": "string"
                  },
                  "timedate": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }'

```

It throw error **mapper\_parsing\_exception**

```
       {
        "error": {
          "root_cause": [
            {
              "type": "mapper_parsing_exception",
              "reason": "Root mapping definition has unsupported parameters: [chatdemo3 : {mappings={chatdemoc={properties={active={type=string}, chat_from={type=string}, chat_to={type=string}, deactive={type=string}, id={type=long}, ip={type=string}, mail={type=string, index=not_analyzed}, message={type=string, index=not_analyzed}, name={type=string, index=not_analyzed}, reason={type=string, index=not_analyzed}, socketid={type=string}, timedate={type=string}}}}}]"
            }
          ],
          "type": "mapper_parsing_exception",
          "reason": "Root mapping definition has unsupported parameters: [chatdemo3 : {mappings={chatdemoc={properties={active={type=string}, chat_from={type=string}, chat_to={type=string}, deactive={type=string}, id={type=long}, ip={type=string}, mail={type=string, index=not_analyzed}, message={type=string, index=not_analyzed}, name={type=string, index=not_analyzed}, reason={type=string, index=not_analyzed}, socketid={type=string}, timedate={type=string}}}}}]"
        },
        "status": 400
      }

```

Suggest me How to update mapping in existing index ?.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [June 16, 2016, 8:38am UTC](https://discuss.elastic.co/t/mapping-problem-while-update-mapping-in-existing-index/52858/2 "2016-06-16T08:38:47Z")

</div>

Hey,

you cannot change from `analyzed` to `not_analyzed`. You either need to reindex and create a new mapping for the new index upfront or use [multi fields](https://www.elastic.co/guide/en/elasticsearch/reference/current/_multi_fields.html)

--Alex

---

<div class="post-metadata">

**Author:** ![Rajkumar\_E](https://avatars.discourse-cdn.com/v4/letter/r/9de053/32.png) [@Rajkumar\_E](https://discuss.elastic.co/u/Rajkumar_E)\
**Post date:** [June 21, 2016, 2:20pm UTC](https://discuss.elastic.co/t/mapping-problem-while-update-mapping-in-existing-index/52858/3 "2016-06-21T14:20:45Z")

</div>

elaticsearch doen't have this feature to update mapping index varibles for existing 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 5, 2017, 10:41pm UTC](https://discuss.elastic.co/t/mapping-problem-while-update-mapping-in-existing-index/52858/4 "2017-07-05T22:41:44Z")

</div>


