From b70b41ec5c6451bb18439460a508382aded478ec Mon Sep 17 00:00:00 2001 From: Rufus Pollock Date: Mon, 22 Oct 2012 21:59:20 +0100 Subject: [PATCH] [#249,docs][s]: document geo_point type throughly. --- docs/models.markdown | 49 ++++++++++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 13 deletions(-) diff --git a/docs/models.markdown b/docs/models.markdown index 593979ba..0b5702b4 100644 --- a/docs/models.markdown +++ b/docs/models.markdown @@ -118,20 +118,43 @@ The type list is as follows (brackets indicate possible aliases for specific types - these types will be recognized and normalized to the default type name for that type): -* string (text) - a string -* number (double, float, numeric) - a number including floating point numbers. -* integer (int) - an integer. -* date - a date. The preferred format is YYYY-MM-DD. -* time - a time without a date -* date-time (datetime, timestamp) a date-time. It is recommended this be in ISO 8601 +* **string (text)**: a string +* **number (double, float, numeric)**: a number including floating point numbers. +* **integer (int)**: an integer. +* **date**: a date. The preferred format is YYYY-MM-DD. +* **time**: a time without a date +* **date-time (datetime, timestamp)**: a date-time. It is recommended this be in ISO 8601 format of YYYY-MM- DDThh:mm:ssZ in UTC time. -* boolean (bool) -* binary - base64 representation of binary data. -* geo_point -* geojson -* array -* object (json) -* any - value of field may be any type +* **boolean (bool)** +* **binary**: base64 representation of binary data. +* **geo_point**: as per + . + That is a field (in these examples named location) that has one of the + following structures: + + location: { + lon: ... + lat: ... + } + + location: [lon,lat] + + location: "lat, lng" + + As bonus there is also support for (beyond the ES style geo_point): + + // geonames style + location: { + lng: ... + lat: ... + } + // found on the web + location: "(lat, lon)" + +* **geojson**: as per +* **array**: an array +* **object (json)**: an object +* **any**: value of field may be any type
NB: types are not validated so you can set the type to whatever value you like (it does not have to be in the above list). However,