Mapping Problem while Update Mapping in existing index

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 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 ?.

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

--Alex

elaticsearch doen't have this feature to update mapping index varibles for existing index.