Faceting by geolocation in Elasticsearch (clustering) -


i have project enables users search pois using elasticsearch, , can filter number of different attributes, including location. i'd add faceting of filters, of categorical variables faceting perfect. however, want users able facet location/city/metro area. each location lat/long pair.

from research, seems best approach use k-means clustering of lat/long pairs common groupings of locations faceting. once have groupings, want provide commonly recognizable name area (e.g., if "brooklyn" center of cluster, i'd want provide name "new york city").

(a) can geo-clustering (k-means, or other way) done in elasticsearch allow faceting location? if so, how? if not, can done in postgres instead? (b) how can make sure i'm providing recognizable political name given region returned clustering?

given lat/long (or address) input, can use google maps geocoding api retrieve (and index) specific hierarchically-scoped labels for:

  • country
  • administrative_area_level_1 (state: in us)
  • administrative_area_level_2 (county: in us)
  • sublocality_level_1 (borough: in nyc)
  • administrative_area_level_3 (city: in us)
  • locality (neighborhood: in us)

if you're building out yelp or airbnb-like search interface zoom-map component, can choose location facet display based diversity criteria:


e.g. request 6 term facets, display 1 appropriate selection diversity (say 2-10 terms) ... example, if zoom level (and bounding box) includes brooklyn, manhattan , staten island, you'll see following:

  • country (united states) ... ignore, broad
  • administrative_area_level_1 (new york) ... ignore, broad
  • administrative_area_level_2 (kings county, new york county, richmond county) ... ignore (just in case of nyc sublocality_level_1 more commonly used)
  • sublocality_level_1: (brooklyn, manhattan, staten island) ... appropriately specific, show this!
  • administrative_area_level_3 (new york city) ... ignore, broad
  • locality (<100s of neighborhoods>) ... ignore, narrow

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -