]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/SearchDescription.php
Search housenumbers with unknown address parts by housenumber term
[nominatim.git] / lib / SearchDescription.php
index ad404528968ad94075bc414af0bc0f5a185873cc..c339b108e749953636736bff2a7e1e2aacfe4ae5 100644 (file)
@@ -247,6 +247,15 @@ class SearchDescription
                     $oSearch->iSearchRank++;
                 }
                 $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)) {
+                    $oSearch = clone $this;
+                    $oSearch->iSearchRank++;
+                    $oSearch->aAddress = $this->aName;
+                    $oSearch->aName = array($oSearchTerm->iId => $oSearchTerm->iId);
+                    $aNewSearches[] = $oSearch;
+                }
             }
         } elseif ($sPhraseType == ''
                   && is_a($oSearchTerm, '\Nominatim\Token\SpecialTerm')