]> git.openstreetmap.org Git - nominatim.git/commitdiff
for postcodes use rank_search as base rank for finding addresses
authorSarah Hoffmann <lonvia@denofr.de>
Tue, 27 Feb 2024 15:57:35 +0000 (16:57 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Wed, 28 Feb 2024 13:40:36 +0000 (14:40 +0100)
The rank_address reflects the position in the address which is
usually lower than what one would expect for a postcode area.

lib-sql/functions/placex_triggers.sql

index 386140f45c00d0f6fae651ccd970c19496ae78e7..0f74336fbc7d2312140219fb30ad547b7c9267cf 100644 (file)
@@ -1265,6 +1265,8 @@ BEGIN
     END IF;
   ELSEIF NEW.rank_address > 25 THEN
     max_rank := 25;
+  ELSEIF NEW.class in ('place','boundary') and NEW.type in ('postcode','postal_code') THEN
+    max_rank := NEW.rank_search;
   ELSE
     max_rank := NEW.rank_address;
   END IF;