title: how to change type of a value in elasticsearch
body: <p>I am trying to do geomap of a value in Elasticsearch but the value type of the <code>client_location</code> is set as a string and I would like to change it to <code>geo_point</code>. When I run the following I am getting:</p>
  
  <pre><code>#curl -XGET "http://core.z0z0.tk:9200/_all/_mappings/http?pretty"
  {
    "packetbeat-2015.12.04" : {
      "mappings" : {
        "http" : {
          "properties" : {
            "@timestamp" : {
              "type" : "date",
              "format" : "strict_date_optional_time||epoch_millis"
            },
            "beat" : {
              "properties" : {
                "hostname" : {
                  "type" : "string"
                },
                "name" : {
                  "type" : "string"
                }
              }
            },
            "bytes_in" : {
              "type" : "long"
            },
            "bytes_out" : {
              "type" : "long"
            },
            "client_ip" : {
              "type" : "string"
            },
            "client_location" : {
              "type" : "string"
            },
            "client_port" : {
              "type" : "long"
            },
            "client_proc" : {
              "type" : "string"
            },
            "client_server" : {
              "type" : "string"
            },
            "count" : {
              "type" : "long"
            },
            "direction" : {
              "type" : "string"
            },
            "http" : {
              "properties" : {
                "code" : {
                  "type" : "long"
                },
                "content_length" : {
                  "type" : "long"
                },
                "phrase" : {
                  "type" : "string"
                }
              }
            },
            "ip" : {
              "type" : "string"
            },
            "method" : {
              "type" : "string"
            },
            "notes" : {
              "type" : "string"
            },
            "params" : {
              "type" : "string"
            },
            "path" : {
              "type" : "string"
            },
            "port" : {
              "type" : "long"
            },
            "proc" : {
              "type" : "string"
            },
            "query" : {
              "type" : "string"
            },
            "responsetime" : {
              "type" : "long"
            },
            "server" : {
              "type" : "string"
            },
            "status" : {
              "type" : "string"
            },
                "type" : {
              "type" : "string"
            }
          }
        }
      }
    }
  }
  </code></pre>
  
  <p>When I run the following command to change the type of the value from string to <code>geo_point</code> I am getting the following error:</p>
  
  <pre><code># curl -XPUT "http://localhost:9200/_all/_mappings/http" -d '
  &gt; {
  &gt; "http" : {
  &gt;         "properties" : {
  &gt;           "client_location" : {
  &gt;             "type" : "geo_point"
  &gt;           }
  &gt;         }
  &gt;   }
  &gt; }
  &gt; '
  {"error":{"root_cause":[{"type":"merge_mapping_exception","reason":"Merge failed with failures {[mapper [client_location] of different type, current_type [string], merged_type[geo_point]]}"}],"type":"merge_mapping_exception","reason":"Merge failed with failures {[mapper [client_location] of different type, current_type [string], merged_type [geo_point]]}"},"status":400}
  </code></pre>
  
  <p>Any suggestion how should I correctly change the type?</p>
  
  <p>Thanks in advance.</p>