X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/b04463bb2d522d37de3ac4e56f2553144ff83604..56fd1bc1b5fde69ec2258aa94c4c9cb493554e41:/sql/functions/placex_triggers.sql?ds=sidebyside

diff --git a/sql/functions/placex_triggers.sql b/sql/functions/placex_triggers.sql
index 8c9cfae1..1f664a4a 100644
--- a/sql/functions/placex_triggers.sql
+++ b/sql/functions/placex_triggers.sql
@@ -211,7 +211,11 @@ BEGIN
     FOR linked_placex IN
       SELECT placex.* from placex
       WHERE make_standard_name(name->'name') = bnd_name
-        AND ((bnd.rank_address > 0 and placex.rank_address = bnd.rank_address)
+        AND ((bnd.rank_address > 0
+              and bnd.rank_address = (compute_place_rank(placex.country_code,
+                                                         'N', placex.class,
+                                                         placex.type, 15::SMALLINT,
+                                                         false, placex.postcode)).address_rank)
              OR (bnd.rank_address = 0 and placex.rank_search = bnd.rank_search))
         AND placex.osm_type = 'N'
         AND placex.rank_search < 26 -- needed to select the right index
