From: Brian Quinion Date: Fri, 25 Mar 2011 11:55:13 +0000 (+0000) Subject: order final data set by importance, ignore search query score (importance seems to... X-Git-Tag: v2.0.0~156 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/bf0710dd64eb421c14ec13363c8dcc3f90072b49 order final data set by importance, ignore search query score (importance seems to be better) --- diff --git a/website/search.php b/website/search.php index 4845faf2..3b5d55ac 100755 --- a/website/search.php +++ b/website/search.php @@ -933,7 +933,7 @@ $sSQL .= "get_name_by_language(name, $sLanguagePrefArraySQL) as placename,"; $sSQL .= "get_name_by_language(name, ARRAY['ref']) as ref,"; $sSQL .= "avg(ST_X(ST_Centroid(geometry))) as lon,avg(ST_Y(ST_Centroid(geometry))) as lat, "; - $sSQL .= $sOrderSQL." as porder, "; +// $sSQL .= $sOrderSQL." as porder, "; $sSQL .= "coalesce(importance,0.9-(rank_search::float/30)) as importance "; $sSQL .= "from placex where place_id in ($sPlaceIDs) "; $sSQL .= "and placex.rank_address between $iMinAddressRank and $iMaxAddressRank "; @@ -948,7 +948,7 @@ $sSQL .= "null as placename,"; $sSQL .= "null as ref,"; $sSQL .= "avg(ST_X(centroid)) as lon,avg(ST_Y(centroid)) as lat, "; - $sSQL .= $sOrderSQL." as porder, "; +// $sSQL .= $sOrderSQL." as porder, "; $sSQL .= "-0.15 as importance "; $sSQL .= "from location_property_tiger where place_id in ($sPlaceIDs) "; $sSQL .= "and 30 between $iMinAddressRank and $iMaxAddressRank "; @@ -960,14 +960,14 @@ $sSQL .= "null as placename,"; $sSQL .= "null as ref,"; $sSQL .= "avg(ST_X(centroid)) as lon,avg(ST_Y(centroid)) as lat, "; - $sSQL .= $sOrderSQL." as porder, "; - $sSQL .= "-0.15 as importance "; +// $sSQL .= $sOrderSQL." as porder, "; + $sSQL .= "-0.10 as importance "; $sSQL .= "from location_property_aux where place_id in ($sPlaceIDs) "; $sSQL .= "and 30 between $iMinAddressRank and $iMaxAddressRank "; $sSQL .= "group by place_id"; if (!$bDeDupe) $sSQL .= ",place_id"; $sSQL .= ",get_address_by_language(place_id, $sLanguagePrefArraySQL) "; - $sSQL .= "order by porder asc"; + $sSQL .= "order by importance desc"; // $sSQL .= "order by rank_search,rank_address,porder asc"; if (CONST_Debug) var_dump('
',$sSQL); $aSearchResults = $oDB->getAll($sSQL);