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
edd31154
Commit
edd31154
authored
Jan 27, 2014
by
Byron Jones
Committed by
Frédéric Buclin
Jan 27, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 76498: QuickSearch: support comparison operators other than substring
r=LpSolit a=justdave
parent
0bd5bfb9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
5 deletions
+65
-5
Quicksearch.pm
Bugzilla/Search/Quicksearch.pm
+19
-5
quicksearch.html.tmpl
template/en/default/pages/quicksearch.html.tmpl
+46
-0
No files found.
Bugzilla/Search/Quicksearch.pm
View file @
edd31154
...
...
@@ -103,6 +103,17 @@ use constant FIELD_OPERATOR => {
owner_idle_time
=>
'greaterthan'
,
};
# Mappings for operators symbols to support operators other than "substring"
use
constant
OPERATOR_SYMBOLS
=>
{
':'
=>
'substring'
,
'='
=>
'equals'
,
'!='
=>
'notequals'
,
'>='
=>
'greaterthaneq'
,
'<='
=>
'lessthaneq'
,
'>'
=>
'greaterthan'
,
'<'
=>
'lessthan'
,
};
# We might want to put this into localconfig or somewhere
use
constant
PRODUCT_EXCEPTIONS
=>
(
'row'
,
# [Browser]
...
...
@@ -391,10 +402,11 @@ sub _handle_field_names {
# Generic field1,field2,field3:value1,value2 notation.
# We have to correctly ignore commas and colons in quotes.
my
@field_values
=
_parse_line
(
':'
,
1
,
$or_operand
);
if
(
scalar
@field_values
==
2
)
{
my
@fields
=
_parse_line
(
','
,
1
,
$field_values
[
0
]);
my
@values
=
_parse_line
(
','
,
1
,
$field_values
[
1
]);
foreach
my
$symbol
(
keys
OPERATOR_SYMBOLS
)
{
my
@field_values
=
parse_line
(
$symbol
,
1
,
$or_operand
);
next
unless
scalar
@field_values
==
2
;
my
@fields
=
parse_line
(
','
,
1
,
$field_values
[
0
]);
my
@values
=
parse_line
(
','
,
1
,
$field_values
[
1
]);
foreach
my
$field
(
@fields
)
{
my
$translated
=
_translate_field_name
(
$field
);
# Skip and record any unknown fields
...
...
@@ -411,7 +423,9 @@ sub _handle_field_names {
$bug_status_set
=
1
;
}
foreach
my
$value
(
@values
)
{
my
$operator
=
FIELD_OPERATOR
->
{
$translated
}
||
'substring'
;
my
$operator
=
FIELD_OPERATOR
->
{
$translated
}
||
OPERATOR_SYMBOLS
->
{
$symbol
}
||
'substring'
;
# If the string was quoted to protect some special
# characters such as commas and colons, we need
# to remove quotes.
...
...
template/en/default/pages/quicksearch.html.tmpl
View file @
edd31154
...
...
@@ -209,6 +209,52 @@
(<kbd>url</kbd> OR <kbd>location</kbd>) AND (<kbd>bar</kbd> OR
<kbd>field</kbd>) AND (NOT <kbd>focus</kbd>)</p>
</li>
<li>
The default operator, colon (:), performs a <strong>substring</strong>
match of the value. The following operators are supported:
<ul>
<li>
<strong>:</strong> (substring):<br>
<kbd><em>summary:foo</em></kbd> will search for [% terms.bugs %]
where the <kbd>summary</kbd> contains <kbd>foo</kbd>.
</li>
<li>
<strong>=</strong> (equals):<br>
<kbd><em>summary=foo</em></kbd> will search for [% terms.bugs %]
where the <kbd>summary</kbd> is exactly <kbd>foo</kbd>.
</li>
<li>
<strong>!=</strong> (notequals):<br>
<kbd><em>summary!=foo</em></kbd> will search for [% terms.bugs %]
where the <kbd>summary</kbd> is not <kbd>foo</kbd>.
</li>
<li>
<strong>></strong> (greaterthan):<br>
<kbd><em>creation_ts>-2w</em></kbd> will search for [% terms.bugs %]
where that were created between two weeks ago and now, excluding [%
terms.bugs %] exactly two weeks old.
</li>
<li>
<strong>>=</strong> (greaterthaneq):<br>
<kbd><em>creation_ts>=-2w</em></kbd> will search for [% terms.bugs %]
where that were created between two weeks ago and now, including [%
terms.bugs %] exactly two weeks old.
</li>
<li>
<strong><</strong> (lessthan):<br>
<kbd><em>creation_ts<-2w</em></kbd> will search for [% terms.bugs %]
where that were created more than two weeks ago, excluding [%
terms.bugs %] exactly two weeks old.
</li>
<li>
<strong><=</strong> (lessthaneq):<br>
<kbd><em>creation_ts<=-2w</em></kbd> will search for [% terms.bugs %]
where that were created more than two weeks ago, including [%
terms.bugs %] exactly two weeks old.
</li>
</ul>
</li>
</ul>
<h2 id="shortcuts">Advanced Shortcuts</h2>
...
...
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