]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge branch 'master' of github.com:twain47/Nominatim
authorSarah Hoffmann <lonvia@denofr.de>
Sat, 13 Oct 2012 07:19:42 +0000 (09:19 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Sat, 13 Oct 2012 07:19:42 +0000 (09:19 +0200)
Conflicts:
munin/nominatim_importlag
utils/setup.php

1  2 
website/search.php

diff --combined website/search.php
index a2d8729f5cde4190264175f240c32b2f52b8f131,30f7abde0e47ea2e49ef6199e039ec3e85c9f612..59d57d58a2620f4ed87622c33179d86dcfa92387
@@@ -41,7 -41,6 +41,7 @@@
        if (isset($aLangPrefOrder['name:de'])) $bReverseInPlan = true;
        if (isset($aLangPrefOrder['name:ru'])) $bReverseInPlan = true;
        if (isset($aLangPrefOrder['name:ja'])) $bReverseInPlan = true;
 +      if (isset($aLangPrefOrder['name:pl'])) $bReverseInPlan = true;
  
        $sLanguagePrefArraySQL = "ARRAY[".join(',',array_map("getDBQuoted",$aLangPrefOrder))."]";
  
                                                        else
                                                        {
                                                                $sSQL = "select place_id from placex where class='".$aSearch['sClass']."' and type='".$aSearch['sType']."'";
-                                                               $sSQL .= " and st_contains($sViewboxSmallSQL, centroid)";
+                                                               $sSQL .= " and st_contains($sViewboxSmallSQL, geometry)";
                                                                if ($sCountryCodesSQL) $sSQL .= " and country_code in ($sCountryCodesSQL)";                                                             
                                                                if ($sViewboxCentreSQL) $sSQL .= " order by st_distance($sViewboxCentreSQL, centroid) asc";
                                                                $sSQL .= " limit $iLimit";
                                                                        $sSQL .= " limit ".$iLimit;
  
                                                                if (CONST_Debug) var_dump($sSQL);
 +                                                              $iStartTime = time();
                                                                $aViewBoxPlaceIDs = $oDB->getAll($sSQL);
                                                                if (PEAR::IsError($aViewBoxPlaceIDs))
                                                                {
                                                                        failInternalError("Could not get places for search terms.", $sSQL, $aViewBoxPlaceIDs);
                                                                }
 +                                                              if (time() - $iStartTime > 60) {
 +                                                                      file_put_contents(CONST_BasePath.'/log/long_queries.log', date('Y-m-d H:i:s', $iStartTime).' '.$sSQL."\n", FILE_APPEND);
 +                                                              }
 +
  //var_dump($aViewBoxPlaceIDs);
                                                                // Did we have an viewbox matches?
                                                                $aPlaceIDs = array();