From: Sarah Hoffmann Date: Sat, 19 Jan 2013 08:29:39 +0000 (+0100) Subject: Merge remote-tracking branch 'upstream/master' X-Git-Tag: deploy~648 X-Git-Url: https://git.openstreetmap.org/nominatim.git/commitdiff_plain/b57dc6addfe6d91ad78642d1f6881d206b7e425a?ds=sidebyside;hp=-c Merge remote-tracking branch 'upstream/master' --- b57dc6addfe6d91ad78642d1f6881d206b7e425a diff --combined website/search.php index 0d398cc4,aee77345..cfc1455f --- a/website/search.php +++ b/website/search.php @@@ -71,7 -71,6 +71,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))."]"; @@@ -164,7 -163,10 +164,10 @@@ } if (sizeof($aStructuredQuery) > 0) { $sQuery = join(', ', $aStructuredQuery); - $sAllowedTypesSQLList = '(\'place\',\'boundary\')'; + if ($iMaxAddressRank < 30) + { + $sAllowedTypesSQLList = '(\'place\',\'boundary\')'; + } } if ($sQuery) @@@ -933,17 -935,12 +936,17 @@@ else $sSQL .= " limit ".$iLimit; - if (CONST_Debug) { var_dump($sSQL); } + 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(); @@@ -1146,7 -1143,7 +1149,7 @@@ if ($iGroupLoop > 4) break; if ($iQueryLoop > 30) break; } - //exit; + // Did we find anything? if (isset($aResultPlaceIDs) && sizeof($aResultPlaceIDs)) {