Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache-friendly viewbox alternative #31

Open
klokan opened this issue Sep 8, 2016 · 1 comment
Open

Cache-friendly viewbox alternative #31

klokan opened this issue Sep 8, 2016 · 1 comment
Milestone

Comments

@klokan
Copy link
Member

klokan commented Sep 8, 2016

We would need to come up with a client calculation of location in a geographical grid which would be attached to the query.

Server would boost the requests for names within the same grid cell - so in first 25 results are for sure the relevant one.

Client would could further refine the order of the 25 results by knowing the actual location and zoom level of the map exactly, and by calculating distance to the candidate lat/long.

@klokan
Copy link
Member Author

klokan commented Sep 8, 2016

Partly related is GeoHash: https://en.wikipedia.org/wiki/Geohash
https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-geohashgrid-aggregation.html

We could also just define fixed number of geographic regions / locations - and either attach none (for zoomed up map) or exactly one of them (for zoomed in map) by the client.

The number of the all possible hashes multiplies the size of cache required.

An alternative to this is to increase the list of returned candidates (this can be cached well on CDN) and do only the client side reordering - but then we have no guarantee the street / place name closest to the viewport is in the list in fact.

@MartinMikita MartinMikita added this to the v2.2 milestone Sep 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants