Posted on: 03/11/03 04:22pm
By: Anonymous (Anonymous)
Is there a way to limit the number of results returned from a search? For example, when I search for "geek" on this site, I get back:
Fatal error: Maximum execution time of 30 seconds exceeded in /usr/home/geeklog/geeklog/system/classes/template.class.php on line 496
It appears that the request timed out because there were too many results to process and display. Is there any fix for this?
Search Result Limits
Posted on: 03/12/03 03:54pm
By: rawdata
My guess is the timeout problem is caused by the way tables are being joined or duplicative results are being returned or both. Joining tables has a multiplicative effect. For example, if you have a table with 10 fields x 100 rows and join it with 10 fields x 100 rows, the dimension becomes 100 x 10,000. If you join another, it gets multiplied again and so on. Depending on the sql call, you can also compound the problem with duplicative results. Geeklog's site has less than 11,500 items to search. This total is nothing for MySQL to handle which leads me to believe one or both of these areas are the problem.
If it helps any, Tony is reworking the search code. Hopefully, he finds and fixes the problem. In the meantime, you can limit the results by narrowing your search criteria (ie select a specific date range, author, or a topic). The timeout seems to be only occurring when someone selects "All". You can always go into search.php and add a limit to the sql calls. If it's a join and/or duplicative problem though, it may only have a temporary effect until you add enough more new info to hit it again.