]> git.openstreetmap.org Git - nominatim.git/commitdiff
order final data set by importance, ignore search query score (importance seems to...
authorBrian Quinion <openstreetmap@brian.quinion.co.uk>
Fri, 25 Mar 2011 11:55:13 +0000 (11:55 +0000)
committerBrian Quinion <openstreetmap@brian.quinion.co.uk>
Fri, 25 Mar 2011 11:55:13 +0000 (11:55 +0000)
website/search.php

index 4845faf237cd510154099b323e3b9fd65fe8350c..3b5d55acea47bbf44846cce441e4de8612e3778b 100755 (executable)
                                        $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 ";
                                        $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 ";
                                        $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('<hr>',$sSQL);
                                        $aSearchResults = $oDB->getAll($sSQL);