Hi,
I just learnt from http://www.elasticsearch.org/blog/0-90-2-released/ about
the improved support for geohashes, and I particularly like that fact that
they can be indexed as edge ngrams.
The blog post highlights the advantage of this when filtering, but I wanted
to see it action with faceting as well, so I set up my index mapping as:
...
"location" : {
"type" : "geo_point",
"geohash_prefix": true
},
...
then I indexed some documents containing a location field with coordinates
and asked the facet below:
{
"size": 0,
"query": {
"match_all": {}
},
"facets": {
"location": {
"terms": {
"field": "location",
"regex" : ".{4}"
}
}
}
}
In order to group docs with identical values in the first 4 characters of
the geohash. But this is not working: I don't get any facet back, unless I
change the regex to .{12}, the length of the full geohash.
After some failed attempts I replaced the regex stuff with
"script" : "term.substring(0, 4)"
and I see the facets, but still I would expect the other method to work as
well. Have I misunderstood something? Or is there a different and better
way to implement this kind of faceting?
Gianluca
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.