上QQ阅读APP看书,第一时间看更新
How to do it...
The type of the field must be set to geo_point to define a GeoPoint.
We can extend the order example by adding a new field that stores the location of a customer. This will be the result as follows:
PUT test/_mapping
{
"properties": {"id": {"type": "keyword",},
"date": {"type": "date"},
"customer_id": {"type": "keyword"},
"customer_ip": {"type": "ip"},
"customer_location": {"type": "geo_point"},
"sent": {"type": "boolean"}
}
}