Merge pull request #1931 from lonvia/stable-sort-for-results

Reranking of results must be stable
This commit is contained in:
Sarah Hoffmann 2020-08-26 20:52:17 +02:00 committed by GitHub
commit a932855f6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -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

View File

@ -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'];
}