Sample geo region facet


holidays, at your parents for too long, split from your better half...
inevitably leads to code :slight_smile:

So I hacked up

It is a small sample facet, which everyone is encouraged to use for his own
projects. The georegion facet groups results, which have a geo location
stored in the document, by arbitrary region. My sample includes a document
for many countries in the world, but you could change that to reflect only
the states in germany or just the continents by changing the configuration
to a different file, which includes the data you need (in GeoJSON format if
I am not mistaken).

When indexing a few towns like Paris, Munich, Berlin and Cologne with its
correct location (as a geo_point type), the facet will return "Germany:3"
and "France:1"...

It is slow as hell, so performance improvements or better integration in
the not too well documented geo features of elasticsearch would be great as
minor tips :slight_smile: (however I do not intend to develop it any further)

Have fun, and reuse whatever you want from the code.