X-Git-Url: https://git.openstreetmap.org/nominatim.git/blobdiff_plain/6a3c6c43ea7133c934834ce1face9212f4e3d239..fd9345cda3745d026597e7b42edcd196e82dc6bb:/lib/SearchDescription.php diff --git a/lib/SearchDescription.php b/lib/SearchDescription.php index bf45dada..4ba28e35 100644 --- a/lib/SearchDescription.php +++ b/lib/SearchDescription.php @@ -58,7 +58,7 @@ class SearchDescription /** * Get current search rank. * - * The higher the search rank the lower the likelyhood that the + * The higher the search rank the lower the likelihood that the * search is a correct interpretation of the search query. * * @return integer Search rank. @@ -262,7 +262,7 @@ class SearchDescription $iOp = Operator::NEAR; // near == in for the moment if ($aSearchTerm['operator'] == '') { - if (sizeof($this->aName)) { + if (sizeof($this->aName) || $this->oContext->isBoundedSearch()) { $iOp = Operator::NAME; } $oSearch->iSearchRank += 2; @@ -326,7 +326,7 @@ class SearchDescription ) { if ($aSearchTerm['search_name_count'] + 1 < CONST_Max_Word_Frequency) { $oSearch = clone $this; - $oSearch->iSearchRank++; + $oSearch->iSearchRank += 2; $oSearch->aAddress[$iWordID] = $iWordID; $aNewSearches[] = $oSearch; } else { @@ -360,7 +360,7 @@ class SearchDescription && (!sizeof($this->aName) || $this->iNamePhrase == $iPhrase) ) { $oSearch = clone $this; - $oSearch->iSearchRank++; + $oSearch->iSearchRank += 2; if (!sizeof($this->aName)) { $oSearch->iSearchRank += 1; }