mirror of
https://github.com/osm-search/Nominatim.git
synced 2024-12-26 22:44:44 +03:00
Merge pull request #1931 from lonvia/stable-sort-for-results
Reranking of results must be stable
This commit is contained in:
commit
a932855f6f
@ -452,11 +452,13 @@ class PlaceLookup
|
||||
$aPlace,
|
||||
$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
|
||||
|
@ -55,7 +55,7 @@ function byImportance($a, $b)
|
||||
if ($a['importance'] != $b['importance'])
|
||||
return ($a['importance'] > $b['importance']?-1:1);
|
||||
|
||||
return ($a['foundorder'] < $b['foundorder']?-1:1);
|
||||
return $a['foundorder'] <=> $b['foundorder'];
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user