# Reindex to add geo\_point mapping

**URL:** <https://discuss.elastic.co/t/reindex-to-add-geo-point-mapping/202052>\
**Category:** Elasticsearch\
**Created:** [October 2, 2019, 8:46pm UTC](https://discuss.elastic.co/t/reindex-to-add-geo-point-mapping/202052 "2019-10-02T20:46:17Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [October 3, 2019, 5:15am UTC](https://discuss.elastic.co/t/reindex-to-add-geo-point-mapping/202052/2 "2019-10-03T05:15:38Z")

</div>

Hi @jbrowe  
You are close but as the error says `geo_points` can not be dynamically converted type so you are going to need to do something like this. Create a little [ingest pipeline](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest.html)e to help with the transformation

See if you can follow this along same principal you just need to change to fit your data

```
DELETE /city

# Put in non geo_point document 
POST /city/_doc
{
  "name": "north stamford",
  "location": {
    "lon": -73.572866,
    "lat": 41.142307
  }
}

GET /city/_search

GET /city/_mapping

DELETE /citynew

# Put the new mapping 
PUT /citynew
{
  "mappings": {
    "properties": {
      "name" : {"type" : "text"},
      "location_fixed": {
        "type": "geo_point"
      }
    }
  }
}

# check the mapping 
GET /citynew/_mapping

  
DELETE /_ingest/pipeline/convert_geo

# Create an ingest pipeline
# Sets the old location into the new geo_point field and drops the old location.
PUT /_ingest/pipeline/convert_geo
{
  "processors": [
    {
      "set": {
        "field": "location_fixed.lat",
        "value": "{{location.lat}}"
      }
    },
    {
      "set": {
        "field": "location_fixed.lon",
        "value": "{{location.lon}}"
      }
    },
    {
      "remove": {
        "field": "location"
      }
    }
  ]
}

#Now reindex using the ingest pipeline
POST _reindex/
{
  "source": {
    "index": "city"
  },
  "dest": {
    "pipeline": "convert_geo", 
    "index": "citynew"
  }
}

# Check out your new index 
GET /citynew/_search

```

Hope this Helps!

In the future you may want to use logstash to do the ingest and do the conversion before it ever gets to elastic search ... but that is another technique for another day...

---

_[View the full topic](https://discuss.elastic.co/t/reindex-to-add-geo-point-mapping/202052)._
