From: Brian Quinion Date: Mon, 24 Jan 2011 11:24:47 +0000 (+0000) Subject: final result ordering, remove GB postcode hacks X-Git-Tag: v2.0.0~178 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/550578b35919aaa6186966d844fea711570f89e1 final result ordering, remove GB postcode hacks --- diff --git a/lib/lib.php b/lib/lib.php index ca71a7b4..2359c930 100644 --- a/lib/lib.php +++ b/lib/lib.php @@ -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); diff --git a/lib/template/search-xml.php b/lib/template/search-xml.php index 3d011b39..b15c9a2e 100644 --- a/lib/template/search-xml.php +++ b/lib/template/search-xml.php @@ -31,6 +31,7 @@ echo " osm_type='$sOSMType'"; echo " osm_id='".$aResult['osm_id']."'"; } + echo " place_rank='".$aResult['rank_search']."'"; if (isset($aResult['aBoundingBox'])) { diff --git a/website/search.php b/website/search.php index c126762a..a0e02469 100755 --- a/website/search.php +++ b/website/search.php @@ -304,7 +304,7 @@ } } if ($bSuggestion) $sSuggestion = join(', ',$aSuggestion); - +/* // Try and calculate GB postcodes we might be missing foreach($aTokens as $sToken) { @@ -322,7 +322,7 @@ } } } - +*/ // Any words that have failed completely? // TODO: suggestions