$iLimit
);
- //now search for housenumber, if housenumber provided
- if ($this->sHouseNumber && !empty($aResults)) {
+ // Now search for housenumber, if housenumber provided. Can be zero.
+ if (($this->sHouseNumber || $this->sHouseNumber === '0') && !empty($aResults)) {
// Downgrade the rank of the street results, they are missing
// the housenumber.
foreach ($aResults as $oRes) {
$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";