]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge pull request #2071 from lonvia/fix-more-ranks
authorSarah Hoffmann <lonvia@denofr.de>
Tue, 24 Nov 2020 20:45:30 +0000 (21:45 +0100)
committerGitHub <noreply@github.com>
Tue, 24 Nov 2020 20:45:30 +0000 (21:45 +0100)
Search rank 30 must always go with address rank 30

.github/workflows/ci-tests.yml
sql/functions/address_lookup.sql
sql/functions/placex_triggers.sql

index 79830673b25d68a89a001d7a42cfc37502cb0076..f1da461686f148db0a438c2f0432c6dfac962198 100644 (file)
@@ -97,3 +97,9 @@ jobs:
                    php ./utils/update.php --init-updates
                    php ./utils/update.php --import-osmosis
               working-directory: build
+
+            - name: Run reverse-only import
+              run : |
+                  dropdb nominatim
+                  php ./utils/setup.php --osm-file ../monaco-latest.osm.pbf --reverse-only --all
+              working-directory: build
index 266e8686d5fde5845dfa05e78776a23df4580fb1..6ee1f048600b005071d2a546f4aaa470d23be396 100644 (file)
@@ -289,7 +289,7 @@ BEGIN
 
   IF search_unlisted_place is not null THEN
     RETURN NEXT ROW(null, null, null, hstore('name', search_unlisted_place),
-                    'place', 'locality', null, null, true, true, 26, 0)::addressline;
+                    'place', 'locality', null, null, true, true, 25, 0)::addressline;
   END IF;
 
   IF searchpostcode IS NOT NULL THEN
index 7d6352b4eda6ea2bdd7fe0dfc6475ba710065f42..6fd9e2258a4f67c91e372a00fd98509f8dfe6343 100644 (file)
@@ -814,8 +814,8 @@ BEGIN
 
       END IF;
 
-      IF array_length(name_vector, 1) is not NULL
-         OR inherited_address is not NULL OR NEW.address is not NULL
+      IF not %REVERSE-ONLY% AND (array_length(name_vector, 1) is not NULL
+         OR inherited_address is not NULL OR NEW.address is not NULL)
       THEN
         SELECT * INTO name_vector, nameaddress_vector
           FROM create_poi_search_terms(NEW.place_id,
@@ -824,7 +824,7 @@ BEGIN
                                        NEW.country_code, NEW.housenumber,
                                        name_vector, NEW.centroid);
 
-        IF not %REVERSE-ONLY% AND array_length(name_vector, 1) is not NULL THEN
+        IF array_length(name_vector, 1) is not NULL THEN
           INSERT INTO search_name (place_id, search_rank, address_rank,
                                    importance, country_code, name_vector,
                                    nameaddress_vector, centroid)