]> git.openstreetmap.org Git - nominatim.git/commitdiff
do not use artificial housenumbers as names
authorSarah Hoffmann <lonvia@denofr.de>
Wed, 25 Nov 2020 15:11:32 +0000 (16:11 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Wed, 25 Nov 2020 15:11:32 +0000 (16:11 +0100)
If they are artificial they cannot have a search_name entry.

lib/SearchDescription.php

index c339b108e749953636736bff2a7e1e2aacfe4ae5..d8c541dbc8f8514d04a5f297d5681c4fb6e8ab54 100644 (file)
@@ -249,7 +249,10 @@ class SearchDescription
                 $aNewSearches[] = $oSearch;
                 // Housenumbers may appear in the name when the place has its own
                 // address terms.
-                if (($this->iNamePhrase >= 0 || empty($this->aName)) && empty($this->aAddress)) {
+                if ($oSearchTerm->iId !== null
+                    && ($this->iNamePhrase >= 0 || empty($this->aName))
+                    && empty($this->aAddress)
+                   ) {
                     $oSearch = clone $this;
                     $oSearch->iSearchRank++;
                     $oSearch->aAddress = $this->aName;