]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/SearchDescription.php
Merge pull request #1936 from lonvia/tweeking-of-ranks
[nominatim.git] / lib / SearchDescription.php
index 4fafbec2b21c9899fb1e35c51ac8241647876b58..33b766a5f5fcacbe09f596d6221370ca49456ef9 100644 (file)
@@ -657,13 +657,10 @@ class SearchDescription
         }
 
         if ($this->sHouseNumber) {
-            $aTerms[] = 'address_rank between 16 and 27';
+            $aTerms[] = 'address_rank between 16 and 30';
         } elseif (!$this->sClass || $this->iOperator == Operator::NAME) {
             if ($iMinAddressRank > 0) {
-                $aTerms[] = 'address_rank >= '.$iMinAddressRank;
-            }
-            if ($iMaxAddressRank < 30) {
-                $aTerms[] = 'address_rank <= '.$iMaxAddressRank;
+                $aTerms[] = "((address_rank between $iMinAddressRank and $iMaxAddressRank) or (search_rank between $iMinAddressRank and $iMaxAddressRank))";
             }
         }