X-Git-Url: https://git.openstreetmap.org/nominatim.git/blobdiff_plain/b68b2ff6b834f4bf6d0b9a0a22ef56c73743a8a8..c5d98effc0f5fcd8d154b0a3ba3fccd374445685:/lib/SearchDescription.php diff --git a/lib/SearchDescription.php b/lib/SearchDescription.php index 94ba87ff..1e1955c2 100644 --- a/lib/SearchDescription.php +++ b/lib/SearchDescription.php @@ -248,6 +248,18 @@ class SearchDescription $oSearch->iSearchRank++; } $aNewSearches[] = $oSearch; + // Housenumbers may appear in the name when the place has its own + // address terms. + if ($oSearchTerm->iId !== null + && ($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')