From b8566e4d8f5bc2df8b90c857a99c0f5c0beaebd8 Mon Sep 17 00:00:00 2001 From: Max Kanat-Alexander Date: Wed, 2 Mar 2011 00:43:43 -0800 Subject: Bug 632718: Only return 500 search results unless the user specifically requests to see more. r=dkl, a=mkanat --- buglist.cgi | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'buglist.cgi') diff --git a/buglist.cgi b/buglist.cgi index 85162ff56..69c4edaec 100755 --- a/buglist.cgi +++ b/buglist.cgi @@ -776,6 +776,14 @@ if ($fulltext and grep { /^relevance/ } @orderstrings) { $vars->{'message'} = 'buglist_sorted_by_relevance' } +# In the HTML interface, by default, we limit the returned results, +# which speeds up quite a few searches where people are really only looking +# for the top results. +if ($format->{'extension'} eq 'html' && !defined $cgi->param('limit')) { + $params->param('limit', Bugzilla->params->{'default_search_limit'}); + $vars->{'default_limited'} = 1; +} + # Generate the basic SQL query that will be used to generate the bug list. my $search = new Bugzilla::Search('fields' => \@selectcolumns, 'params' => scalar $params->Vars, @@ -783,6 +791,9 @@ my $search = new Bugzilla::Search('fields' => \@selectcolumns, my $query = $search->sql; $vars->{'search_description'} = $search->search_description; +# We don't want saved searches and other buglist things to save +# our default limit. +$params->delete('limit') if $vars->{'default_limited'}; ################################################################################ # Query Execution -- cgit v1.2.1