X-Git-Url: https://git.openstreetmap.org/nominatim.git/blobdiff_plain/182f5f5d7b4e3e01fc0ab60a263fa213260bde57..d5e8c5e975b270a0839af1b54ef5308857d92225:/lib-php/SearchDescription.php diff --git a/lib-php/SearchDescription.php b/lib-php/SearchDescription.php index 913a90d2..8e8e5acb 100644 --- a/lib-php/SearchDescription.php +++ b/lib-php/SearchDescription.php @@ -289,7 +289,7 @@ class SearchDescription $oSearch->aAddress[$iWordID] = $iWordID; $aNewSearches[] = $oSearch; } - } else { + } else if (empty($this->aNameNonSearch)) { $oSearch = clone $this; $oSearch->iSearchRank++; $oSearch->aName = array($iWordID => $iWordID); @@ -347,10 +347,13 @@ class SearchDescription } if ((!$this->sPostcode && !$this->aAddress && !$this->aAddressNonSearch) - && (empty($this->aName) || $this->iNamePhrase == $iPhrase) + && ((empty($this->aName) && empty($this->aNameNonSearch)) || $this->iNamePhrase == $iPhrase) ) { $oSearch = clone $this; $oSearch->iSearchRank++; + if (empty($this->aName) && empty($this->aNameNonSearch)) { + $oSearch->iSearchRank++; + } if (preg_match('#^[0-9 ]+$#', $sToken)) { $oSearch->iSearchRank++; }