How to update the mapping in Elasticsearch to change the field datatype and change the type of analyzers in string : <p>While trying to update the mapping I get the following error:</p>

<pre><code>{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"mapper [timestamp] of different type, current_type [string], merged_type [date]"}],"type":"illegal_argument_exception","reason":"
mapper [timestamp] of different type, current_type [string], merged_type [date]"},"status":400}
</code></pre>

<p>I m trying to run the following command on windows</p>

<pre><code>   curl -XPUT localhost:9200/logstash-*/_mapping/log?update_all_types -d "{
    "properties":
    {
        "timestamp": 
        {
            "type": "date", 
            "format": "MM-dd-yyyy HH:mm:ss",
            "fielddata":{"loading" : "lazy"} }
        }
    }";
</code></pre>

<p>How I can change the datatype of date field from string to date type with a particular format.</p>

<p>I tried to change the mapping of a string datatype to change it to <code>eager</code> loading and <code>not_analyzed</code> from analyzed, but it gives the following error:</p>

<pre><code>{"root_cause":[{"type":"illegal_argument_exception","reason":"Mapper for [AppName] conflicts with existing mapping in other types:\n[mapper [AppName] has different [index] values, mapper [App
 different [doc_values] values, cannot change from disabled to enabled, mapper [AppName] has different [analyzer]]"}],"type":"illegal_argument_exception","reason":"Mapper for [AppName] conflict with
existing mapping in other types:\n[mapper [AppName] has different [index] values, mapper [AppName] has different [doc_values] values, cannot change from disabled to enabled, mapper [AppName]
rent [analyzer]]"},"status":400}
</code></pre>

<p>Here is my query for the same:</p>

<pre><code> curl -XPUT localhost:9200/logstash-*/_mapping/log?update_all_types -d "{
"properties":
    {"AppName":
        {
        "type": "string", 
        "index" : "not_analyzed",
        "fielddata":{"loading" : "eager"}
        }
    }
}"
</code></pre>

<p>However, if I change it from <code>not_analyzed</code> to <code>analyzed</code> it gives a <code>acknowledged=true</code> message. How can I change the analyzer.  </p>
