summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Search
diff options
context:
space:
mode:
authorDavid Lawrence <dlawrence@mozilla.com>2011-02-18 19:13:59 +0100
committerDavid Lawrence <dlawrence@mozilla.com>2011-02-18 19:13:59 +0100
commit6aad3a0979417a4e131a2ac45ceabfe840aa4af6 (patch)
tree1232546a7ed43a73b4338365918ac49ec30b099a /Bugzilla/Search
parent8cef0a14747ab7b9a1b9e2dfb98fe44eeace06d6 (diff)
downloadbugzilla-6aad3a0979417a4e131a2ac45ceabfe840aa4af6.tar.gz
bugzilla-6aad3a0979417a4e131a2ac45ceabfe840aa4af6.tar.xz
Bug 580490 - Quicksearch should optionally not search comments
r/a=mkanat
Diffstat (limited to 'Bugzilla/Search')
-rw-r--r--Bugzilla/Search/Quicksearch.pm8
1 files changed, 5 insertions, 3 deletions
diff --git a/Bugzilla/Search/Quicksearch.pm b/Bugzilla/Search/Quicksearch.pm
index 340421bbb..25850a378 100644
--- a/Bugzilla/Search/Quicksearch.pm
+++ b/Bugzilla/Search/Quicksearch.pm
@@ -128,7 +128,7 @@ use constant COMPONENT_EXCEPTIONS => (
);
# Quicksearch-wide globals for boolean charts.
-our ($chart, $and, $or);
+our ($chart, $and, $or, $fulltext);
sub quicksearch {
my ($searchstring) = (@_);
@@ -142,6 +142,8 @@ sub quicksearch {
$searchstring =~ s/(^[\s,]+|[\s,]+$)//g;
ThrowUserError('buglist_parameters_required') unless ($searchstring);
+ $fulltext = Bugzilla->user->settings->{'quicksearch_fulltext'}->{'value'} eq 'on' ? 1 : 0;
+
if ($searchstring =~ m/^[0-9,\s]*$/) {
_bug_numbers_only($searchstring);
}
@@ -317,7 +319,7 @@ sub _handle_special_first_chars {
if ($firstChar eq '#') {
addChart('short_desc', 'substring', $baseWord, $negate);
- addChart('content', 'matches', _matches_phrase($baseWord), $negate);
+ addChart('content', 'matches', _matches_phrase($baseWord), $negate) if $fulltext;
return 1;
}
if ($firstChar eq ':') {
@@ -489,7 +491,7 @@ sub _default_quicksearch_word {
addChart('alias', 'substring', $word, $negate);
addChart('short_desc', 'substring', $word, $negate);
addChart('status_whiteboard', 'substring', $word, $negate);
- addChart('content', 'matches', _matches_phrase($word), $negate);
+ addChart('content', 'matches', _matches_phrase($word), $negate) if $fulltext;
}
sub _handle_urls {