]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorSarah Hoffmann <lonvia@denofr.de>
Sun, 24 Feb 2013 22:07:36 +0000 (23:07 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Sun, 24 Feb 2013 22:07:36 +0000 (23:07 +0100)
1  2 
website/search.php

diff --combined website/search.php
index 6319a83502e778140942c673f1e69f8d4f0ee522,b223dbcfb2c60984d27745a3c59ce18a6e75d3ff..a6e94f5e2c807842ed981063577565649ae8811d
@@@ -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))."]";
  
                                {
                                        $aValidTokens[$aToken['word_token']] = array($aToken);
                                }
-                               if ($aToken['word_token'][0]==' ' && !$aToken['class'] && !$aToken['country_code']) $aPossibleMainWordIDs[$aToken['word_id']] = 1;
+                               if (!$aToken['class'] && !$aToken['country_code']) $aPossibleMainWordIDs[$aToken['word_id']] = 1;
                                $aWordFrequencyScores[$aToken['word_id']] = $aToken['search_name_count'] + 1;
                        }
                        if (CONST_Debug) var_Dump($aPhrases, $aValidTokens);
                                                                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();