]> git.openstreetmap.org Git - nominatim.git/commitdiff
avoid calling add_location for non-addressing features
authorSarah Hoffmann <lonvia@denofr.de>
Wed, 25 Mar 2015 21:22:36 +0000 (22:22 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Wed, 25 Mar 2015 21:25:03 +0000 (22:25 +0100)
sql/functions.sql

index 5f52a6a9f1a3bb6825fe204c28d4895a2e09ac00..02cdc6805b768242bf7cf191ad97f5bd22a5550c 100644 (file)
@@ -1642,7 +1642,7 @@ BEGIN
         -- Performance, it would be more acurate to do all the rest of the import process but it takes too long
         -- Just be happy with inheriting from parent road only
 
         -- Performance, it would be more acurate to do all the rest of the import process but it takes too long
         -- Just be happy with inheriting from parent road only
 
-        IF NEW.rank_search <= 25 THEN
+        IF NEW.rank_search <= 25 and NEW.rank_address > 0 THEN
           result := add_location(NEW.place_id, NEW.calculated_country_code, NEW.partition, name_vector, NEW.rank_search, NEW.rank_address, NEW.geometry);
         END IF;
 
           result := add_location(NEW.place_id, NEW.calculated_country_code, NEW.partition, name_vector, NEW.rank_search, NEW.rank_address, NEW.geometry);
         END IF;
 
@@ -1978,7 +1978,7 @@ BEGIN
     -- if we have a name add this to the name search table
     IF NEW.name IS NOT NULL THEN
 
     -- if we have a name add this to the name search table
     IF NEW.name IS NOT NULL THEN
 
-      IF NEW.rank_search <= 25 THEN
+      IF NEW.rank_search <= 25 and NEW.rank_address > 0 THEN
         result := add_location(NEW.place_id, NEW.calculated_country_code, NEW.partition, name_vector, NEW.rank_search, NEW.rank_address, NEW.geometry);
       END IF;
 
         result := add_location(NEW.place_id, NEW.calculated_country_code, NEW.partition, name_vector, NEW.rank_search, NEW.rank_address, NEW.geometry);
       END IF;