X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/fb8bb301444bd85bd6ac4ed7fd55a62812fdb3a3..d3425c4fa916369116dec8a3f20d73b7ee9bd512:/sql/functions/placex_triggers.sql?ds=inline

diff --git a/sql/functions/placex_triggers.sql b/sql/functions/placex_triggers.sql
index e1790248..f9d5b60f 100644
--- a/sql/functions/placex_triggers.sql
+++ b/sql/functions/placex_triggers.sql
@@ -861,7 +861,9 @@ BEGIN
   END IF;
 
   SELECT * FROM insert_addresslines(NEW.place_id, NEW.partition,
-                                    NEW.rank_search, NEW.address,
+                                    CASE WHEN NEW.rank_address = 0
+                                      THEN NEW.rank_search ELSE NEW.rank_address END,
+                                    NEW.address,
                                     CASE WHEN NEW.rank_search >= 26
                                              AND NEW.rank_search < 30
                                       THEN NEW.geometry ELSE NEW.centroid END)
