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
35f99bbe
Commit
35f99bbe
authored
Mar 29, 2010
by
Max Kanat-Alexander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 554986: Add a "notmatches" search type, which allows the minus sign
operator to start working for bare words in Quicksearch again r=LpSolit, a=LpSolit
parent
8f04aae6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
22 deletions
+15
-22
Search.pm
Bugzilla/Search.pm
+10
-7
Quicksearch.pm
Bugzilla/Search/Quicksearch.pm
+2
-11
code-error.html.tmpl
template/en/default/global/code-error.html.tmpl
+0
-3
field-descs.none.tmpl
template/en/default/global/field-descs.none.tmpl
+1
-0
list.html.tmpl
template/en/default/list/list.html.tmpl
+1
-1
boolean-charts.html.tmpl
template/en/default/search/boolean-charts.html.tmpl
+1
-0
No files found.
Bugzilla/Search.pm
View file @
35f99bbe
...
...
@@ -615,7 +615,7 @@ sub init {
"^long_?desc,changedby"
=>
\&
_long_desc_changedby
,
"^long_?desc,changedbefore"
=>
\&
_long_desc_changedbefore_after
,
"^long_?desc,changedafter"
=>
\&
_long_desc_changedbefore_after
,
"^content,matches"
=>
\&
_content_matches
,
"^content,
(?:not)?
matches"
=>
\&
_content_matches
,
"^content,"
=>
sub
{
ThrowUserError
(
"search_content_without_matches"
);
},
"^(?:deadline|creation_ts|delta_ts),(?:lessthan|lessthaneq|greaterthan|greaterthaneq|equals|notequals),(?:-|\\+)?(?:\\d+)(?:[dDwWmMyY])\$"
=>
\&
_timestamp_compare
,
"^commenter,(?:equals|anyexact),(%\\w+%)"
=>
\&
_commenter_exact
,
...
...
@@ -660,6 +660,7 @@ sub init {
",lessthan"
=>
\&
_lessthan
,
",lessthaneq"
=>
\&
_lessthaneq
,
",matches"
=>
sub
{
ThrowUserError
(
"search_content_without_matches"
);
},
",notmatches"
=>
sub
{
ThrowUserError
(
"search_content_without_matches"
);
},
",greaterthan"
=>
\&
_greaterthan
,
",greaterthaneq"
=>
\&
_greaterthaneq
,
",anyexact"
=>
\&
_anyexact
,
...
...
@@ -1420,8 +1421,8 @@ sub _long_desc_changedbefore_after {
sub
_content_matches
{
my
$self
=
shift
;
my
%
func_args
=
@_
;
my
(
$chartid
,
$supptables
,
$term
,
$groupby
,
$fields
,
$v
)
=
@func_args
{
qw(chartid supptables term groupby fields v)
};
my
(
$chartid
,
$supptables
,
$term
,
$groupby
,
$fields
,
$
t
,
$
v
)
=
@func_args
{
qw(chartid supptables term groupby fields
t
v)
};
my
$dbh
=
Bugzilla
->
dbh
;
# "content" is an alias for columns containing text for which we
...
...
@@ -1448,19 +1449,21 @@ sub _content_matches {
# The term to use in the WHERE clause.
$$term
=
"$term1 > 0 OR $term2 > 0"
;
if
(
$$t
=~
/not/i
)
{
$$term
=
"NOT($$term)"
;
}
# In order to sort by relevance (in case the user requests it),
# we SELECT the relevance value so we can add it to the ORDER BY
# clause. Every time a new fulltext chart isadded, this adds more
# terms to the relevance sql. (That doesn't make sense in
# "NOT" charts, but Bugzilla never uses those with fulltext
# by default.)
# terms to the relevance sql.
#
# We build the relevance SQL by modifying the COLUMNS list directly,
# which is kind of a hack but works.
my
$current
=
COLUMNS
->
{
'relevance'
}
->
{
name
};
$current
=
$current
?
"$current + "
:
''
;
my
$select_term
=
"($current$rterm1 + $rterm2)"
;
# For NOT searches, we just add 0 to the relevance.
my
$select_term
=
$$t
=~
/not/
?
0
:
"($current$rterm1 + $rterm2)"
;
COLUMNS
->
{
'relevance'
}
->
{
name
}
=
$select_term
;
}
...
...
Bugzilla/Search/Quicksearch.pm
View file @
35f99bbe
...
...
@@ -524,19 +524,10 @@ sub matchPrefixes {
sub
negateComparisonType
{
my
$comparisonType
=
shift
;
if
(
$comparisonType
eq
'substring'
)
{
return
'notsubstring'
;
}
elsif
(
$comparisonType
eq
'anywords'
)
{
if
(
$comparisonType
eq
'anywords'
)
{
return
'nowords'
;
}
elsif
(
$comparisonType
eq
'regexp'
)
{
return
'notregexp'
;
}
else
{
# Don't know how to negate that
ThrowCodeError
(
'unknown_comparison_type'
);
}
return
"not$comparisonType"
;
}
# Add a boolean chart
...
...
template/en/default/global/code-error.html.tmpl
View file @
35f99bbe
...
...
@@ -422,9 +422,6 @@
An error occurred while preparing for a RADIUS authentication request:
<code>[% errstr FILTER html %]</code>.
[% ELSIF error == "unknown_comparison_type" %]
Specified comparison type is not supported.
[% ELSIF error == "request_queue_group_invalid" %]
The group field <em>[% group FILTER html %]</em> is invalid.
...
...
template/en/default/global/field-descs.none.tmpl
View file @
35f99bbe
...
...
@@ -49,6 +49,7 @@
"changedto" => "changed to",
"changedby" => "changed by",
"matches" => "matches",
"notmatches" => "does not match",
} %]
[% field_types = { ${constants.FIELD_TYPE_UNKNOWN} => "Unknown Type",
...
...
template/en/default/list/list.html.tmpl
View file @
35f99bbe
...
...
@@ -85,7 +85,7 @@
'notequals', 'regexp', 'notregexp', 'lessthan', 'lessthaneq',
'greaterthan', 'greaterthaneq', 'changedbefore', 'changedafter',
'changedfrom', 'changedto', 'changedby', 'notsubstring', 'nowords',
'nowordssubstr',
'nowordssubstr',
'notmatches',
] %]
<ul class="search_description">
[% FOREACH desc_item = search_description %]
...
...
template/en/default/search/boolean-charts.html.tmpl
View file @
35f99bbe
...
...
@@ -46,6 +46,7 @@
"changedto",
"changedby",
"matches",
"notmatches",
] %]
<h3 id="chart">
...
...
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