0

I would like to convert the following to a geo_point type

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

The issue that I am running into is that the field source.geo.location is not of type geo_point. I would like to modify the location mapping to look like this

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

Here is a picture of the problem shown on the geo visualization enter image description here

Someone has ran into a similar issue:https://discuss.elastic.co/t/how-to-construct-geo-point-field-from-separate-fields-of-latitude-and-longitude-for-kibana-5-4/91755. This doesn't really help me because I need to update an existing index. I'm not sure if this can be done, but I would love it if someone could help me or point me in the right directoin.

ᴀʀᴍᴀɴ
  • 4,443
  • 8
  • 37
  • 57
Evan Gertis
  • 1,796
  • 2
  • 25
  • 59

1 Answers1

0

Once you've set the geo_point mapping, you won't need the two float data types.

In essence, you'd need to drop your index, correctly define the mapping, and then reindex your data. There's no other way because converting from a dictionary of floats to a geo point is considered a "mapping breaking change."

Maybe my answer to Elastic Search Geo Spatial search implementation would help you get started.

Joe - GMapsBook.com
  • 15,787
  • 4
  • 23
  • 68