diff options
-rw-r--r-- | Bugzilla/Search/Quicksearch.pm | 7 | ||||
-rw-r--r-- | template/en/default/pages/quicksearch.html.tmpl | 8 |
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 %] |