- Elasticsearch 7.0 Cookbook(Fourth Edition)
- Alberto Paro
- 68字
- 2021-06-24 14:52:08
There's more...
GeoPoint is a special type and can accept several formats as input:
- lat and lon as properties, as shown here:
{
"customer_location": {
"lat": 45.61752,
"lon": 9.08363
},
- lan and lon as string, as follows:
"customer_location": "45.61752,9.08363",
- geohash string, as shown here:
"customer_location": "u0n7w8qmrfj",
- As a GeoJSON array (note in it lat and lon are reversed), shown in the following code snippet:
"customer_location": [9.08363, 45.61752]