mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-26 11:08:13 +00:00
Merge pull request #1931 from lonvia/stable-sort-for-results
Reranking of results must be stable
This commit is contained in:
@@ -452,11 +452,13 @@ class PlaceLookup
|
|||||||
$aPlace,
|
$aPlace,
|
||||||
$aPlace['country_code']
|
$aPlace['country_code']
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$aResults[$aPlace['place_id']] = $aPlace;
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug::printVar('Places', $aPlaces);
|
Debug::printVar('Places', $aResults);
|
||||||
|
|
||||||
return $aPlaces;
|
return $aResults;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* returns an array which will contain the keys
|
/* returns an array which will contain the keys
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ function byImportance($a, $b)
|
|||||||
if ($a['importance'] != $b['importance'])
|
if ($a['importance'] != $b['importance'])
|
||||||
return ($a['importance'] > $b['importance']?-1:1);
|
return ($a['importance'] > $b['importance']?-1:1);
|
||||||
|
|
||||||
return ($a['foundorder'] < $b['foundorder']?-1:1);
|
return $a['foundorder'] <=> $b['foundorder'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user