X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/7be7417b5bf8ee801295d402e736c531892b77ca..c3e276b23bb306bc777cf99fcf22cd7344c2246e:/sql/functions/placex_triggers.sql

diff --git a/sql/functions/placex_triggers.sql b/sql/functions/placex_triggers.sql
index b84a2d6d..8d537855 100644
--- a/sql/functions/placex_triggers.sql
+++ b/sql/functions/placex_triggers.sql
@@ -99,12 +99,12 @@ BEGIN
         --DEBUG: RAISE WARNING 'Checked for nearest way (%)', parent_place_id;
       ELSE
         -- for larger features simply find the area with the largest rank that
-        -- contains the bbox
+        -- contains the bbox, only use addressable features
         FOR location IN
           SELECT place_id FROM placex
             WHERE bbox @ geometry AND _ST_Covers(geometry, ST_Centroid(bbox))
-                  AND rank_search between 5 and 25
-            ORDER BY rank_search desc
+                  AND rank_address between 5 and 25
+            ORDER BY rank_address desc
         LOOP
             RETURN location.place_id;
         END LOOP;
