Geo points lat/lon

I have data which is mapped with:

 "location" : {
                "properties" : {
                  "lon" : {
                    "type" : "long"
                  },
                  "lat" : {
                    "type" : "long"
                  }
                }
              }

I want to use visualization on my dashboard, but Geohash says there's no geo point in my index. Can I change just type from long to geo_point or I need to use whole field location as geo_point?

You need to define location as a geo point.
You need to reindex.

My question was, should it be

"location" : {
                "properties" : {
                  "lon" : {
                    "type" : "geo_point"
                  },
                  "lat" : {
                    "type" : "geo_point"
                  }
                }
              }

or must be only one field (without lat and lon)

{
    "mappings": {
        "_doc": {
            "properties": {
                "location": {
                    "type": "geo_point"
                }
            }
        }
    }
}

EDIT - I tried both, always get an error while reindexing..

It must be the later

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