According to ElasticSearch documents it is possible to have an array of lat and long in the mapping as a Geo point type.
Mapping:
PUT my_index
{
"mappings": {
"my_type": {
"properties": {
"location": {
"type": "geo_point"
}
}
}
}
}
Format in [lon, lat], note, the order of lon/lat here in order to conform with GeoJSON.
PUT my_index/my_type/4
{
"text": "Geo-point as an array",
"location": [ -71.34, 41.12 ]
}
Other examples for Geo-point datatype:
- Geo-point expressed as a string with the format: "lat,lon"
- Geo-point expressed as a geohash
- Geo-point expressed as an array with the format: [ lon, lat]