X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/388c7f706d43be1e025ac9250b5a068dff3c0a01..9908c93d4cec91b5109d4fbc83dde18b5076350f:/lib/SearchDescription.php diff --git a/lib/SearchDescription.php b/lib/SearchDescription.php index ec14e546..204a7358 100644 --- a/lib/SearchDescription.php +++ b/lib/SearchDescription.php @@ -453,6 +453,9 @@ class SearchDescription if (empty($aResults) && $this->looksLikeFullAddress()) { $aResults = $aNamedPlaceIDs; + foreach ($aResults as $oRes) { + $oRes->iResultRank++; + } } } @@ -469,16 +472,13 @@ class SearchDescription if ($sPlaceIds) { $sSQL = 'SELECT place_id FROM placex'; $sSQL .= ' WHERE place_id in ('.$sPlaceIds.')'; - $sSQL .= " AND postcode = '".$this->sPostcode."'"; + $sSQL .= " AND postcode != '".$this->sPostcode."'"; Debug::printSQL($sSQL); $aFilteredPlaceIDs = chksql($oDB->getCol($sSQL)); if ($aFilteredPlaceIDs) { - $aNewResults = array(); foreach ($aFilteredPlaceIDs as $iPlaceId) { - $aNewResults[$iPlaceId] = $aResults[$iPlaceId]; + $aResults[$iPlaceId]->iResultRank++; } - $aResults = $aNewResults; - Debug::printVar('Place IDs after postcode filtering', $aResults); } } }