]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/SearchDescription.php
Correct spelling mistakes.
[nominatim.git] / lib / SearchDescription.php
index 60d7417347cd287083edd734ba681286085d0bba..4ba28e352abe7dee676898a614f20494e5eac177 100644 (file)
@@ -58,7 +58,7 @@ class SearchDescription
     /**
      * Get current search rank.
      *
     /**
      * 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.
      * 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'] == '') {
 
                 $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;
                         $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;
         ) {
             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 {
                 $oSearch->aAddress[$iWordID] = $iWordID;
                 $aNewSearches[] = $oSearch;
             } else {