X-Git-Url: https://git.openstreetmap.org/nominatim.git/blobdiff_plain/ec2d491dc8939ecf28ab84e26955bc7189618096..0176cbd25323447163193114ca15ed83d71db36a:/lib/SearchDescription.php diff --git a/lib/SearchDescription.php b/lib/SearchDescription.php index 358e6969..47676d59 100644 --- a/lib/SearchDescription.php +++ b/lib/SearchDescription.php @@ -187,7 +187,7 @@ class SearchDescription ) { if (!$this->sCountryCode) { $oSearch = clone $this; - $oSearch->iSearchRank++; + $oSearch->iSearchRank += 2; $oSearch->sCountryCode = $oSearchTerm->sCountryCode; // Country is almost always at the end of the string // - increase score for finding it anywhere else (optimisation) @@ -588,6 +588,9 @@ class SearchDescription $sSQL .= "p.postcode = '".reset($this->aName)."'"; $sSQL .= $this->countryCodeSQL(' AND p.country_code'); + if ($this->oContext->bViewboxBounded) { + $sSQL .= ' AND ST_Intersects('.$this->oContext->sqlViewboxSmall.', geometry)'; + } $sSQL .= $this->oContext->excludeSQL(' AND p.place_id'); $sSQL .= " LIMIT $iLimit";