mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-15 19:07:58 +00:00
increase penalty for places without housenumber
Results where the housenumber was dropped are an unlikely result when they refer to something other than a street. Therefore increase their result rank so that other matches are tried first before choosing them as a result. Improves #2167.
This commit is contained in:
@@ -778,7 +778,7 @@ class Geocode
|
||||
if (!empty($aResults)) {
|
||||
$aSplitResults = Result::splitResults($aResults);
|
||||
Debug::printVar('Split results', $aSplitResults);
|
||||
if ($iGroupLoop <= 4 && empty($aSplitResults['tail'])
|
||||
if ($iGroupLoop <= 4
|
||||
&& reset($aSplitResults['head'])->iResultRank > 0) {
|
||||
// Haven't found an exact match for the query yet.
|
||||
// Therefore add result from the next group level.
|
||||
@@ -786,6 +786,10 @@ class Geocode
|
||||
foreach ($aNextResults as $oRes) {
|
||||
$oRes->iResultRank--;
|
||||
}
|
||||
foreach ($aSplitResults['tail'] as $oRes) {
|
||||
$oRes->iResultRank--;
|
||||
$aNextResults[$oRes->iId] = $oRes;
|
||||
}
|
||||
$aResults = array();
|
||||
} else {
|
||||
$aResults = $aSplitResults['head'];
|
||||
|
||||
Reference in New Issue
Block a user