]> git.openstreetmap.org Git - nominatim.git/commitdiff
do not restrict by viewbox when housenumber or postcode is available
authorSarah Hoffmann <lonvia@denofr.de>
Sat, 6 Jan 2024 15:53:48 +0000 (16:53 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Sun, 7 Jan 2024 10:29:26 +0000 (11:29 +0100)
Fixes #3274.

nominatim/api/search/db_searches.py

index cc352134cffd313ab5dd846357021359c0fc8105..254d2ca6703e8f20c4056a694b8a15c4353e841a 100644 (file)
@@ -663,7 +663,7 @@ class PlaceSearch(AbstractSearch):
                 sql = sql.where(tsearch.c.centroid
                                          .intersects(VIEWBOX_PARAM,
                                                      use_index=details.viewbox.area < 0.2))
-            elif self.expected_count >= 10000:
+            elif not self.postcodes and not self.housenumbers and self.expected_count >= 10000:
                 sql = sql.where(tsearch.c.centroid
                                          .intersects(VIEWBOX2_PARAM,
                                                      use_index=details.viewbox.area < 0.5))