Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
b8566e4d
Commit
b8566e4d
authored
Mar 02, 2011
by
Max Kanat-Alexander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 632718: Only return 500 search results unless the user specifically
requests to see more. r=dkl, a=mkanat
parent
e81b9d51
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
14 deletions
+53
-14
Query.pm
Bugzilla/Config/Query.pm
+7
-0
Search.pm
Bugzilla/Search.pm
+1
-1
buglist.cgi
buglist.cgi
+11
-0
query.html.tmpl
template/en/default/admin/params/query.html.tmpl
+10
-1
list.html.tmpl
template/en/default/list/list.html.tmpl
+24
-12
No files found.
Bugzilla/Config/Query.pm
View file @
b8566e4d
...
...
@@ -74,6 +74,13 @@ sub get_param_list {
},
{
name
=>
'default_search_limit'
,
type
=>
't'
,
default
=>
'500'
,
checker
=>
\&
check_numeric
},
{
name
=>
'max_search_results'
,
type
=>
't'
,
default
=>
'10000'
,
...
...
Bugzilla/Search.pm
View file @
b8566e4d
...
...
@@ -920,7 +920,7 @@ sub _sql_limit {
$limit
=
$max_results
;
}
if
(
defined
$offset
and
not
defined
$limit
)
{
if
(
defined
(
$offset
)
&&
!
$limit
)
{
$limit
=
INT_MAX
;
}
if
(
defined
$limit
)
{
...
...
buglist.cgi
View file @
b8566e4d
...
...
@@ -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
...
...
template/en/default/admin/params/query.html.tmpl
View file @
b8566e4d
...
...
@@ -55,9 +55,18 @@
"Whether to allow a search on the 'Simple Search' page with an empty"
_ " 'Words' field.",
default_search_limit =>
"By default, $terms.Bugzilla limits searches done in the web"
_ " interface to returning only this many results, for performance"
_ " reasons. (This only affects the HTML format of search results--CSV,"
_ " XML, and other formats are exempted.) Users can click a link on the"
_ " search result page to see all the results."
_ "<p>Usually you should not have to change this--the default value"
_ " should be acceptable for almost most installations.</p>",
max_search_results =>
"The maximum number of $terms.bugs that a search can"
_ " <strong>ever</strong> return. Tabular and graphical reports"
_ " are exempted from this limit, however."
_ " are exempted from this limit, however."
,
} %]
template/en/default/list/list.html.tmpl
View file @
b8566e4d
...
...
@@ -110,9 +110,7 @@
[%############################################################################%]
[% IF bugs.size > 9 %]
<span class="bz_result_count">
[% bugs.size %] [%+ terms.bugs %] found.
</span>
[% PROCESS num_results %]
[% END %]
[%############################################################################%]
...
...
@@ -134,15 +132,7 @@
[%# Succeeding Status Line #%]
[%############################################################################%]
<span class="bz_result_count">
[% IF bugs.size == 0 %]
<span class="zero_results">[% terms.zeroSearchResults %].</span>
[% ELSIF bugs.size == 1 %]
One [% terms.bug %] found.
[% ELSE %]
[% bugs.size %] [%+ terms.bugs %] found.
[% END %]
</span>
[% PROCESS num_results %]
[% IF bugs.size == 0 %]
<ul class="zero_result_links">
...
...
@@ -274,6 +264,10 @@
[% PROCESS global/footer.html.tmpl %]
[%##########%]
[%# Blocks #%]
[%##########%]
[% BLOCK edit_search_url %]
[% editqueryname = searchname OR defaultsavename OR '' %]
query.cgi?[% urlquerypart FILTER html %]
...
...
@@ -291,3 +285,21 @@
in the "[% one_product.name FILTER html %]" product
[% END %]</a>
[% END %]
[% BLOCK num_results %]
<span class="bz_result_count">
[% IF bugs.size == 0 %]
<span class="zero_results">[% terms.zeroSearchResults %].</span>
[% ELSIF default_limited AND bugs.size >= Param('default_search_limit') %]
This result was limited to [% Param('default_search_limit') FILTER html %]
[%+ terms.bugs %].
<a href="buglist.cgi?[% urlquerypart FILTER html %]
[%- "&order=$qorder" FILTER html IF order %]&limit=0">See
all search results for this query</a>.
[% ELSIF bugs.size == 1 %]
One [% terms.bug %] found.
[% ELSE %]
[% bugs.size %] [%+ terms.bugs %] found.
[% END %]
</span>
[% END %]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment