]> git.openstreetmap.org Git - nominatim.git/commitdiff
final result ordering, remove GB postcode hacks
authorBrian Quinion <openstreetmap@brian.quinion.co.uk>
Mon, 24 Jan 2011 11:24:47 +0000 (11:24 +0000)
committerBrian Quinion <openstreetmap@brian.quinion.co.uk>
Mon, 24 Jan 2011 11:24:47 +0000 (11:24 +0000)
lib/lib.php
lib/template/search-xml.php
website/search.php

index ca71a7b4efd0fc00b805ee084a59c1a4249f2715..2359c930b57e13ed21f17637b1344f87bee703b4 100644 (file)
@@ -44,6 +44,8 @@
                        return ($a['aPointPolygon']['numfeatures'] > $b['aPointPolygon']['numfeatures']?-1:1);
                if ($a['aPointPolygon']['area'] != $b['aPointPolygon']['area'])
                        return ($a['aPointPolygon']['area'] > $b['aPointPolygon']['area']?-1:1);
+               if ($a['levenshtein'] != $b['levenshtein'])
+                       return ($a['levenshtein'] < $b['levenshtein']?-1:1);
                if ($a['importance'] != $b['importance'])
                        return ($a['importance'] < $b['importance']?-1:1);
                return ($a['foundorder'] < $b['foundorder']?-1:1);
index 3d011b39c4d65708d59e484da5571a739f36cbf7..b15c9a2efb7dc5abf5e90cd6e56eef663bb2bc1a 100644 (file)
@@ -31,6 +31,7 @@
                        echo " osm_type='$sOSMType'";\r
                        echo " osm_id='".$aResult['osm_id']."'";\r
                }\r
+               echo " place_rank='".$aResult['rank_search']."'";\r
 \r
                if (isset($aResult['aBoundingBox']))\r
                {\r
index c126762a7a06c19a797ae123b099f750c91909dd..a0e0246921e58e26e3e3644994c077747147c635 100755 (executable)
                                }
                        }
                        if ($bSuggestion) $sSuggestion = join(', ',$aSuggestion);
-
+/*
                        // Try and calculate GB postcodes we might be missing
                        foreach($aTokens as $sToken)
                        {
                                        }
                                }
                        }
-
+*/
                        // Any words that have failed completely?
                        // TODO: suggestions