X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/d396505786ce3be105249c740e0d3365beb4ef10..932d945b7f897fd18be7d4c2fac3eda3915aa296:/website/search.php diff --git a/website/search.php b/website/search.php index 5e2ff371..cc73513e 100755 --- a/website/search.php +++ b/website/search.php @@ -310,7 +310,12 @@ // Check which tokens we have, get the ID numbers $sSQL = 'select word_id,word_token, word, class, type, location, country_code, operator'; $sSQL .= ' from word where word_token in ('.join(',',array_map("getDBQuoted",$aTokens)).')'; - $sSQL .= ' and (class is null or class not in (\'highway\'))'; + // HACK WARNING + // (mis)using search_name_count to exclude words that return too many + // search results. saerch_name_count is currently set to 1 by hand + // because there is no fast way to extract this count from a live database. + $sSQL .= ' and search_name_count = 0'; +// $sSQL .= ' and (class is null or class not in (\'highway\'))'; // $sSQL .= ' group by word_token, word, class, type, location, country_code'; if (CONST_Debug) var_Dump($sSQL); @@ -789,11 +794,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();