X-Git-Url: https://git.openstreetmap.org/nominatim.git/blobdiff_plain/d42aa0870592b36ba9c64eae05a0ceafd2467f4c..08f77067cb4b32c91f991924ff718a0508f0fbef:/lib/SearchDescription.php diff --git a/lib/SearchDescription.php b/lib/SearchDescription.php index 56d04478..702e7dea 100644 --- a/lib/SearchDescription.php +++ b/lib/SearchDescription.php @@ -68,19 +68,6 @@ class SearchDescription return $this->iSearchRank; } - /** - * Increase the search rank. - * - * @param integer $iAddRank Number of ranks to increase. - * - * @return void - */ - public function addToRank($iAddRank) - { - $this->iSearchRank += $iAddRank; - return $this->iSearchRank; - } - /** * Make this search a POI search. * @@ -187,12 +174,10 @@ class SearchDescription * @param bool $bFirstPhrase True if the token is in the first phrase of * the query. * @param bool $bLastToken True if the token is at the end of the query. - * @param integer $iGlobalRank Changable ranking of all searches in the - * batch. * * @return SearchDescription[] List of derived search descriptions. */ - public function extendWithFullTerm($aSearchTerm, $bHasPartial, $sPhraseType, $bFirstToken, $bFirstPhrase, $bLastToken, &$iGlobalRank) + public function extendWithFullTerm($aSearchTerm, $bHasPartial, $sPhraseType, $bFirstToken, $bFirstPhrase, $bLastToken) { $aNewSearches = array(); @@ -210,12 +195,6 @@ class SearchDescription $oSearch->iSearchRank += 5; } $aNewSearches[] = $oSearch; - - // If it is at the beginning, we can be almost sure that - // the terms are in the wrong order. Increase score for all searches. - if ($bFirstToken) { - $iGlobalRank++; - } } } elseif (($sPhraseType == '' || $sPhraseType == 'postalcode') && $aSearchTerm['class'] == 'place' && $aSearchTerm['type'] == 'postcode' @@ -268,7 +247,10 @@ class SearchDescription $oSearch->iSearchRank++; } // also must not appear in the middle of the address - if (sizeof($this->aAddress) || sizeof($this->aAddressNonSearch)) { + if (sizeof($this->aAddress) + || sizeof($this->aAddressNonSearch) + || $this->sPostcode + ) { $oSearch->iSearchRank++; } $aNewSearches[] = $oSearch;