summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2012-10-24 00:19:23 +0200
committerByron Jones <bjones@mozilla.com>2012-10-24 00:19:23 +0200
commitacb2992c9b3baf976346c6ce5ae60e107551134d (patch)
tree16b7bee6bf202145c1bf9be8c2afe5e2eaea0c8a
parenta9b17a0963dda9e9e8c2c538410fd040b45f1b56 (diff)
downloadbugzilla-acb2992c9b3baf976346c6ce5ae60e107551134d.tar.gz
bugzilla-acb2992c9b3baf976346c6ce5ae60e107551134d.tar.xz
Bug 803058: add a shortcut to quicksearch to enable or disable comment searching for that query
-rw-r--r--Bugzilla/Search/Quicksearch.pm7
-rw-r--r--template/en/default/pages/quicksearch.html.tmpl8
2 files changed, 14 insertions, 1 deletions
diff --git a/Bugzilla/Search/Quicksearch.pm b/Bugzilla/Search/Quicksearch.pm
index 54592f07e..215cc842e 100644
--- a/Bugzilla/Search/Quicksearch.pm
+++ b/Bugzilla/Search/Quicksearch.pm
@@ -161,6 +161,8 @@ sub quicksearch {
ThrowUserError('quicksearch_invalid_query')
if ($words[0] =~ /^(?:AND|OR)$/ || $words[$#words] =~ /^(?:AND|OR|NOT)$/);
+ $fulltext = Bugzilla->user->setting('quicksearch_fulltext') eq 'on' ? 1 : 0;
+
my (@qswords, @or_group);
while (scalar @words) {
my $word = shift @words;
@@ -187,6 +189,10 @@ sub quicksearch {
}
unshift(@words, "-$word");
}
+ # --comment and ++comment disable or enable fulltext searching
+ elsif ($word =~ /^(--|\+\+)comments?$/i) {
+ $fulltext = $1 eq '--' ? 0 : 1;
+ }
else {
# OR groups words together, as OR has higher precedence than AND.
push(@or_group, $word);
@@ -203,7 +209,6 @@ sub quicksearch {
shift(@qswords) if $bug_status_set;
my (@unknownFields, %ambiguous_fields);
- $fulltext = Bugzilla->user->setting('quicksearch_fulltext') eq 'on' ? 1 : 0;
# Loop over all main-level QuickSearch words.
foreach my $qsword (@qswords) {
diff --git a/template/en/default/pages/quicksearch.html.tmpl b/template/en/default/pages/quicksearch.html.tmpl
index 901f05467..c43047d9f 100644
--- a/template/en/default/pages/quicksearch.html.tmpl
+++ b/template/en/default/pages/quicksearch.html.tmpl
@@ -303,6 +303,14 @@
<strong>#</strong><em>value</em>
</td>
</tr>
+ <tr>
+ <td class="field_name">Comment Searching</td>
+ <td class="field_nickname">
+ Allows overriding of the comment searching preference.<br>
+ "<strong>++comments</strong>" will always enable comment searching.<br>
+ "<strong>--comments</strong>" will always disable searching.<br>
+ </td>
+ </tr>
[% IF Param('usestatuswhiteboard') %]
<tr>
<td class="field_name">[% field_descs.short_desc FILTER html %]