pelias / api

HTTP API for Pelias Geocoder
http://pelias.io
MIT License
218 stars 162 forks source link

Search and autocomplete focus.point queries have different scale #1206

Open orangejulius opened 6 years ago

orangejulius commented 6 years ago

The scale parameter to our center_point calculations used when users pass a focus.point parameter differs on search and autocomplete:

Both changes date back to 2015, and there's no immediately obvious reason why they are at those particular values, let alone different values.

Relevant Elasticsearch documentation: The Closer, The Better

Additionally, we should consider carefully if the linear decay function is what we want. As it stands, no focus boosting is applied to results at a distance over 2x the scale parameter, so 100km for search, and 500km for autocomplete.

It might make sense to switch to the exponential decay function, which would allow even very far away results to be compared by distance. A particularly relevant use case here is for postal codes. There are often duplicate postal codes in different places of the world, so even a slight score difference based on distance would allow us to properly order postal code results from different countries.

Also worth noting, this may have overlap with #1205

jd327 commented 6 years ago

Nice, glad to see there's some progress on this! Here are some issues we hear about often from our customers (maybe this will help in your tests):