From: Sarah Hoffmann Date: Sat, 13 Oct 2012 07:19:42 +0000 (+0200) Subject: Merge branch 'master' of github.com:twain47/Nominatim X-Git-Tag: deploy~668 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/7fba4ec99738cc69ee773e7f79418a9353029aaa?hp=-c Merge branch 'master' of github.com:twain47/Nominatim Conflicts: munin/nominatim_importlag utils/setup.php --- 7fba4ec99738cc69ee773e7f79418a9353029aaa diff --combined website/search.php index a2d8729f,30f7abde..59d57d58 --- a/website/search.php +++ b/website/search.php @@@ -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))."]"; @@@ -730,7 -729,7 +730,7 @@@ 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"; @@@ -792,16 -791,11 +792,16 @@@ $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();