From: Sarah Hoffmann Date: Thu, 1 May 2014 08:34:42 +0000 (+0200) Subject: experimental ordering of searches within same rank X-Git-Tag: v2.3.0~16 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/0b545ba093add069fa42bb2e00e1a54b05530ea2 experimental ordering of searches within same rank giving preference to those without operator and housenumber --- diff --git a/lib/lib.php b/lib/lib.php index d3b88711..74e971b4 100644 --- a/lib/lib.php +++ b/lib/lib.php @@ -94,7 +94,8 @@ function bySearchRank($a, $b) { - if ($a['iSearchRank'] == $b['iSearchRank']) return 0; + if ($a['iSearchRank'] == $b['iSearchRank']) + return strlen($a['sOperator']) + strlen($a['sHouseNumber']) - strlen($b['sOperator']) - strlen($b['sHouseNumber']); return ($a['iSearchRank'] < $b['iSearchRank']?-1:1); }