aman verma
aman verma

Reputation: 762

How to define mapping of Geo_Points in elasticsearch?

Can anybody please tell me what is the correct way of mapping a geo_point in elasticsearch, i also want to index lats and longs seperately, from below two declarations which is correct

location          : {"type":"geo_point", "lat_lon": "true"},

OR

location          : {"type":"geo_point", "lat_lon": "true"
                  lat: { type:"double"},
                  lon: { type: "double"}

},

Upvotes: 0

Views: 130

Answers (1)

ulric260
ulric260

Reputation: 374

lat_lon: Set to true to also index the .lat and .lon as fields. Defaults to false. (link)

So you should use the first solution.

Example

Upvotes: 1

Related Questions