From: Sarah Hoffmann Date: Thu, 30 Mar 2023 07:58:02 +0000 (+0200) Subject: limit results for country lookup X-Git-Tag: v4.3.0~86^2 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/1e2a1d9ce5e81d399cdd4c8dc7f4d9c13f63a27b limit results for country lookup --- diff --git a/nominatim/api/reverse.py b/nominatim/api/reverse.py index 1c9cd4c1..42fe8f36 100644 --- a/nominatim/api/reverse.py +++ b/nominatim/api/reverse.py @@ -500,7 +500,8 @@ class ReverseGeocoder: .where(t.c.rank_address == 4)\ .where(t.c.rank_search == 4)\ .where(t.c.linked_place_id == None)\ - .order_by('distance') + .order_by('distance')\ + .limit(1) sql = self._add_geometry_columns(sql, t.c.geometry)