]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorSarah Hoffmann <lonvia@denofr.de>
Sat, 19 Jan 2013 08:29:39 +0000 (09:29 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Sat, 19 Jan 2013 08:29:39 +0000 (09:29 +0100)
1  2 
website/search.php

diff --combined website/search.php
index 0d398cc43db216255a251bc20eacb59efa9fed04,aee77345c5c29305c07d7c6670eb7c08a866d74c..cfc1455f28c85b4bd5190efa415cbd2faa5c77dc
@@@ -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))."]";
  
        }
        if (sizeof($aStructuredQuery) > 0) {
                $sQuery = join(', ', $aStructuredQuery);
-               $sAllowedTypesSQLList = '(\'place\',\'boundary\')';
+               if ($iMaxAddressRank < 30)
+               {
+                       $sAllowedTypesSQLList = '(\'place\',\'boundary\')';
+               }
        }
  
        if ($sQuery)
                                                                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();
                                        if ($iGroupLoop > 4) break;
                                        if ($iQueryLoop > 30) break;
                                }
- //exit;
                                // Did we find anything?        
                                if (isset($aResultPlaceIDs) && sizeof($aResultPlaceIDs))
                                {