summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Search.pm
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2008-07-01 15:12:12 +0200
committermkanat%bugzilla.org <>2008-07-01 15:12:12 +0200
commit7b6d4bdc2c4c9368479150bb333659b00cece1d5 (patch)
tree844d0cf0f212762aac91517ffb1278c530ebb7c3 /Bugzilla/Search.pm
parentd01126162b7ce20025e0eadad34115fbd4080fda (diff)
downloadbugzilla-7b6d4bdc2c4c9368479150bb333659b00cece1d5.tar.gz
bugzilla-7b6d4bdc2c4c9368479150bb333659b00cece1d5.tar.xz
Bug 432601: [Oracle] Fix 'Find a specific Bug' (fulltext searching)
Patch By Xiaoou Wu <xiaoou.wu@oracle.com> r=mkanat, a=mkanat
Diffstat (limited to 'Bugzilla/Search.pm')
-rw-r--r--Bugzilla/Search.pm12
1 files changed, 8 insertions, 4 deletions
diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm
index 272b41152..2f8d86c8e 100644
--- a/Bugzilla/Search.pm
+++ b/Bugzilla/Search.pm
@@ -1239,16 +1239,20 @@ sub _content_matches {
"ON bugs.bug_id = $table.bug_id");
# Create search terms to add to the SELECT and WHERE clauses.
- my $term1 = $dbh->sql_fulltext_search("$table.$comments_col", $$v);
- my $term2 = $dbh->sql_fulltext_search("$table.short_desc", $$v);
-
+ my ($term1, $rterm1) = $dbh->sql_fulltext_search("$table.$comments_col",
+ $$v, 1);
+ my ($term2, $rterm2) = $dbh->sql_fulltext_search("$table.short_desc",
+ $$v, 2);
+ $rterm1 = $term1 if !$rterm1;
+ $rterm2 = $term2 if !$rterm2;
+
# The term to use in the WHERE clause.
$$term = "$term1 > 0 OR $term2 > 0";
# In order to sort by relevance (in case the user requests it),
# we SELECT the relevance value and give it an alias so we can
# add it to the SORT BY clause when we build it in buglist.cgi.
- my $select_term = "($term1 + $term2) AS relevance";
+ my $select_term = "($rterm1 + $rterm2) AS relevance";
# Users can specify to display the relevance field, in which case
# it'll show up in the list of fields being selected, and we need