]> git.openstreetmap.org Git - nominatim.git/blobdiff - sql/functions/ranking.sql
integrate analyse of indexing into nominatim tool
[nominatim.git] / sql / functions / ranking.sql
index 51dcd0d03dd76d937719fb1b45ce00ff17e89307..1f2362114c322077a281f4d59f029181341e3913 100644 (file)
@@ -194,10 +194,10 @@ BEGIN
       FROM get_postcode_rank(country, postcode);
   ELSEIF extended_type = 'N' AND place_class = 'highway' THEN
     search_rank = 30;
-    address_rank = 0;
+    address_rank = 30;
   ELSEIF place_class = 'landuse' AND extended_type != 'A' THEN
     search_rank = 30;
-    address_rank = 0;
+    address_rank = 30;
   ELSE
     IF place_class = 'boundary' and place_type = 'administrative' THEN
       classtype = place_type || admin_level::TEXT;
@@ -211,11 +211,8 @@ BEGIN
            AND l.class = place_class AND (l.type = classtype or l.type is NULL)
      ORDER BY l.country_code, l.class, l.type LIMIT 1;
 
-    IF search_rank is NULL THEN
+    IF search_rank is NULL OR address_rank is NULL THEN
       search_rank := 30;
-    END IF;
-
-    IF address_rank is NULL THEN
       address_rank := 30;
     END IF;