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