# How to update type of existing field to geo\_point?

**URL:** <https://discuss.elastic.co/t/how-to-update-type-of-existing-field-to-geo-point/252988>\
**Category:** Elasticsearch\
**Created:** [October 22, 2020, 11:02am UTC](https://discuss.elastic.co/t/how-to-update-type-of-existing-field-to-geo-point/252988 "2020-10-22T11:02:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dattack13](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dattack13/32/70452_2.png) [@dattack13](https://discuss.elastic.co/u/dattack13)\
**Post date:** [October 22, 2020, 11:02am UTC](https://discuss.elastic.co/t/how-to-update-type-of-existing-field-to-geo-point/252988/1 "2020-10-22T11:02:27Z")

</div>

Hi I have an existing index which has location inside the property address which is like below -

```
"location" : {
              "properties" : {
                "lat" : {
                  "type" : "float"
                },
                "lon" : {
                  "type" : "float"
                }
              }
            },

```

But I wanted to convert it to geo\_point and I tried with below code -

```
{
  "mappings": {
    "doc": {
      "properties": {
        "address.location": {
          "type": "geo_point"
        }
      }
    }
  }
}

```

and getting error -

```
{
  "error" : {
    "root_cause" : [
      {
        "type" : "resource_already_exists_exception",
        "reason" : "index [myIndex/jjUU55BJQrOb1GA4nvO3VA] already exists",
        "index_uuid" : "jjUU55BJQrOb1GA4nvO3VA",
        "index" : "myIndex"
      }
    ],
    "type" : "resource_already_exists_exception",
    "reason" : "index [myIndex/jjUU55BJQrOb1GA4nvO3VA] already exists",
    "index_uuid" : "jjUU55BJQrOb1GA4nvO3VA",
    "index" : "myIndex"
  },
  "status" : 400
}

```

can someone help me to update the type in existing field -

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [October 22, 2020, 11:46am UTC](https://discuss.elastic.co/t/how-to-update-type-of-existing-field-to-geo-point/252988/2 "2020-10-22T11:46:12Z")

</div>

You can't update an existing field like this. You need to create another index and reindex.

---

<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:** [November 19, 2020, 11:46am UTC](https://discuss.elastic.co/t/how-to-update-type-of-existing-field-to-geo-point/252988/3 "2020-11-19T11:46:27Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
