X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/0f87da017f83b321770044e52d7034894448dee6..bf0f81adcb1972a761cdce512fdf03c98830d304:/lib/SearchDescription.php?ds=inline 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')