# Update mapping for geoip.location

**URL:** <https://discuss.elastic.co/t/update-mapping-for-geoip-location/41244>\
**Category:** Elasticsearch\
**Created:** [February 9, 2016, 7:08am UTC](https://discuss.elastic.co/t/update-mapping-for-geoip-location/41244 "2016-02-09T07:08:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gromit](https://avatars.discourse-cdn.com/v4/letter/g/ac8455/32.png) [@gromit](https://discuss.elastic.co/u/gromit)\
**Post date:** [February 9, 2016, 7:08am UTC](https://discuss.elastic.co/t/update-mapping-for-geoip-location/41244/1 "2016-02-09T07:08:05Z")

</div>

Using Elasticsearch 2,2 I'm trying to update the field type for geoip.location (currently mapped as type 'number') to type geo\_point using the following request:

```
myindex/_mapping/

{
  "properties": {
    "geoip.location": {
      "type": "geo_point"
    }
  }
}

```

Result is:

```
{
  "error": {
    "root_cause": [
      {
        "type": "mapper_parsing_exception",
        "reason": "Field name [geoip.location] cannot contain '.'"
      }
    ],
    "type": "mapper_parsing_exception",
    "reason": "Field name [geoip.location] cannot contain '.'"
  },
  "status": 400
}

```

Any ideas how I can do this?

---

<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:** [February 9, 2016, 7:45am UTC](https://discuss.elastic.co/t/update-mapping-for-geoip-location/41244/2 "2016-02-09T07:45:39Z")

</div>

Something like:

```
{
  "properties": {
    "geoip": {
      "type": "object",
      "properties": {
         "location": {
             "type": "geo_point"
        }
    }
  }
}

```

That said, elasticsearch will refuse to do it as you can't change an existing field. You'll have to create a new field or type or index and reindex.

---

<div class="post-metadata">

**Author:** ![gromit](https://avatars.discourse-cdn.com/v4/letter/g/ac8455/32.png) [@gromit](https://discuss.elastic.co/u/gromit)\
**Post date:** [February 9, 2016, 8:01am UTC](https://discuss.elastic.co/t/update-mapping-for-geoip-location/41244/3 "2016-02-09T08:01:05Z")

</div>

Ok, thanks. If I was to create a new template for this time based index, would it be like this?

```
{
    "template" : "myindex*",
    "settings" : {
        "number_of_shards" : 5
    },
"mappings": {
"properties" : {
"geoip": {
      "type": "object",
      "properties": {
         "location": {
             "type": "geo_point"
         }
       }
     }
   }
 }
}
```

---

<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:** [February 9, 2016, 8:32am UTC](https://discuss.elastic.co/t/update-mapping-for-geoip-location/41244/4 "2016-02-09T08:32:03Z")

</div>

Probably. I did not test it but it looks good.

Side note: please format your code when posting in discuss. It makes your posts more readable.

---

<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, 11:18pm UTC](https://discuss.elastic.co/t/update-mapping-for-geoip-location/41244/5 "2017-07-05T23:18:01Z")

</div>


