Commit Graph

17 Commits

Author SHA1 Message Date
Itz-Agasta
9c2d4f4285 Adds language-aware country penalty in forward geocoding
Threads the caller's Accept-Language preference into ForwardGeocoder
and uses it in rerank_by_query to check whether the query matches the
localized name of a country result.

If the caller's locale renders the country name differently (e.g. pt-BR
gives "Brasil" ≠ "Brasilia"), the country's importance is added as an
accuracy penalty, neutralising its dominance over lower-ranked places.

If the locale matches (e.g. Finnish gives "Brasilia" = "Brasilia"),
no penalty is applied and the country correctly wins.
2026-03-03 18:06:22 +05:30
Itz-Agasta
855f451a5f Adds lazy loading for search endpoint availability
Introduces a mechanism to defer the search endpoint's availability check until the first request, improving startup robustness. If the search table is unavailable due to DB issues, the endpoint now responds with a 503 or 404 as appropriate, and retries the check on subsequent requests. This ensures that downtime or partial DB failures no longer prevent the API from initializing or serving reverse-only mode.
2026-02-18 21:46:55 +05:30
Sarah Hoffmann
6a6a064ef7 enable entrances for reverse and lookup 2026-01-23 17:38:47 +01:00
Ayush Dhar Dubey
4fd616254a update Locales constructor:
expect output names as argument and avoid redundant configuration initialization
2025-12-20 19:15:33 +05:30
Sarah Hoffmann
177b16b89b use new QueryStatistics in API server 2025-09-10 11:52:06 +02:00
Emily Love Watson
e916d27b7c Update entrances when entrance nodes are updated 2025-08-29 10:26:29 -05:00
Emily Love Watson
823ad5d279 Update entrances schema 2025-08-29 10:26:29 -05:00
anqixxx
6b627df4fb Locales and localization refactor with Locales as a localizer object.
Removed auto-localization from search/search_address APIs (now explicit), simplified AddressLines to subclass List[AddressLine], made display_name a computed property in Results instead of field and removed result-localization circular dependencies
2025-08-12 08:05:37 -04:00
Sarah Hoffmann
cf9e8d6b8e split up query for deletable endpoint by osm type
This is needed to ensure index use on placex.
2025-07-08 11:03:29 +02:00
Sarah Hoffmann
20d0fb35ce enable search endpoint only when search table is available 2024-11-14 08:53:09 +01:00
Sarah Hoffmann
1f07967787 fix style issue found by flake8 2024-11-10 22:47:14 +01:00
Sarah Hoffmann
5a61d3d5f6 configurable error formatting and content type in result formatter 2024-08-14 12:00:08 +02:00
Sarah Hoffmann
0c25e80be0 make formatting module non-static 2024-08-13 22:39:43 +02:00
Sarah Hoffmann
4e0602919c move ASGIAdoptor out of v1 module 2024-08-13 21:32:11 +02:00
Sarah Hoffmann
d22ca186e4 remove v1-specific functions from ASGIAdaptor 2024-08-13 19:38:14 +02:00
Sarah Hoffmann
4da4cbfe27 reduce from 3 to 2 packages 2024-06-28 09:13:22 +02:00
Sarah Hoffmann
6e89310a92 split code into submodules 2024-06-26 11:52:47 +02:00