X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/7ea860b2c083a0b1c3cc99fb07cd803b2000f880..c61b5219f9eeb48b09d5e74e1f5afc5a955682b9:/lib/SearchDescription.php diff --git a/lib/SearchDescription.php b/lib/SearchDescription.php index 506d4202..bb478b29 100644 --- a/lib/SearchDescription.php +++ b/lib/SearchDescription.php @@ -447,8 +447,8 @@ class SearchDescription $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) { @@ -660,10 +660,7 @@ class SearchDescription $aTerms[] = 'address_rank between 16 and 27'; } 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))"; } }