Is there a way to store a geo_point but get the "lat,long" instead of
geohash when faceting?
curl -XPOST localhost:9200/test -d '{
"settings" : {
"number_of_shards" : 1
},
"mappings" : {
"type1" : {
"_source" : { "enabled" : false },
"properties" : {
"message" : { "type" : "string", "index" : "analyzed" },
"latlon":{"type":"geo_point",
"geohash":true,
"lat_lon":true,
"geohash_precision":4
}
}
}
}
}'
curl -XPUT 'localhost:9200/test/type1/1' -d '
{
"message" : "something blue",
"latlon" : "-23.53,-46.62"
}
'
curl -XPUT 'localhost:9200/test/type1/2' -d '
{
"message" : "something green",
"latlon" : "40.71,-74.01"
}
'
curl -XPOST 'localhost:9200/_refresh'
curl -XPOST 'localhost:9200/test/_search?pretty=true' -d '
{
"query" : {
"term" : { "message" : "something" }
},
"facets" : {
"geo" : {
"terms" : { "field" : "latlon" }
}
}
}
returns
"facets" : {
"geo" : {
"_type" : "terms",
"missing" : 0,
"total" : 2,
"other" : 0,
"terms" : [ {
"term" : "dr5reg58fn01",
"count" : 1
}, {
"term" : "6gyf5hkrg606",
"count" : 1
} ]
}
}
--