]> git.openstreetmap.org Git - nominatim.git/commitdiff
experimental ordering of searches within same rank
authorSarah Hoffmann <lonvia@denofr.de>
Thu, 1 May 2014 08:34:42 +0000 (10:34 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Wed, 3 Sep 2014 18:46:41 +0000 (20:46 +0200)
giving preference to those without operator and housenumber

lib/lib.php

index d3b88711b0b82200989ee6f8983db104e0d5a0a0..74e971b4804f1d32dc6da9bde7a05dfc4abfe2f0 100644 (file)
@@ -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);
        }