final result ordering, remove GB postcode hacks

This commit is contained in:
Brian Quinion
2011-01-24 11:24:47 +00:00
parent 1c0fc63c6f
commit 550578b359
3 changed files with 5 additions and 2 deletions

View File

@@ -44,6 +44,8 @@
return ($a['aPointPolygon']['numfeatures'] > $b['aPointPolygon']['numfeatures']?-1:1); return ($a['aPointPolygon']['numfeatures'] > $b['aPointPolygon']['numfeatures']?-1:1);
if ($a['aPointPolygon']['area'] != $b['aPointPolygon']['area']) if ($a['aPointPolygon']['area'] != $b['aPointPolygon']['area'])
return ($a['aPointPolygon']['area'] > $b['aPointPolygon']['area']?-1:1); 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']) if ($a['importance'] != $b['importance'])
return ($a['importance'] < $b['importance']?-1:1); return ($a['importance'] < $b['importance']?-1:1);
return ($a['foundorder'] < $b['foundorder']?-1:1); return ($a['foundorder'] < $b['foundorder']?-1:1);

View File

@@ -31,6 +31,7 @@
echo " osm_type='$sOSMType'"; echo " osm_type='$sOSMType'";
echo " osm_id='".$aResult['osm_id']."'"; echo " osm_id='".$aResult['osm_id']."'";
} }
echo " place_rank='".$aResult['rank_search']."'";
if (isset($aResult['aBoundingBox'])) if (isset($aResult['aBoundingBox']))
{ {

View File

@@ -304,7 +304,7 @@
} }
} }
if ($bSuggestion) $sSuggestion = join(', ',$aSuggestion); if ($bSuggestion) $sSuggestion = join(', ',$aSuggestion);
/*
// Try and calculate GB postcodes we might be missing // Try and calculate GB postcodes we might be missing
foreach($aTokens as $sToken) foreach($aTokens as $sToken)
{ {
@@ -322,7 +322,7 @@
} }
} }
} }
*/
// Any words that have failed completely? // Any words that have failed completely?
// TODO: suggestions // TODO: suggestions