summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Search.pm
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2006-08-26 07:03:35 +0200
committermkanat%bugzilla.org <>2006-08-26 07:03:35 +0200
commit3f868ed5858dec2b8523c2997c2ebbb2f379cc7a (patch)
tree32ad6cec80fdefeffa0b9034d2b42b85795bb79e /Bugzilla/Search.pm
parent40a2b11f6279554debafdc415754a9d28d9fefaa (diff)
downloadbugzilla-3f868ed5858dec2b8523c2997c2ebbb2f379cc7a.tar.gz
bugzilla-3f868ed5858dec2b8523c2997c2ebbb2f379cc7a.tar.xz
Bug 347864: Generally improve fulltext search
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=myk, a=myk
Diffstat (limited to 'Bugzilla/Search.pm')
-rw-r--r--Bugzilla/Search.pm14
1 files changed, 3 insertions, 11 deletions
diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm
index 87c07129a..92ed27b80 100644
--- a/Bugzilla/Search.pm
+++ b/Bugzilla/Search.pm
@@ -591,7 +591,7 @@ sub init {
# short_desc searching for the WHERE clause
my @words = _split_words_into_like('bugs.short_desc', $v);
- my $term2_where = join(' AND ', @words);
+ my $term2_where = join(' OR ', @words);
# short_desc relevance
my $factor = SUMMARY_RELEVANCE_FACTOR;
@@ -605,18 +605,10 @@ sub init {
# 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.
#
- # Note: MySQL calculates relevance for each comment separately,
- # so we need to do some additional calculations to get an overall
- # relevance value, which we do by calculating the average (mean)
- # comment relevance and then adding the summary relevance, if any.
- # This weights summary relevance heavily, which makes sense
- # since summaries are short and thus highly significant.
- #
- # Note: We should be calculating the average relevance of all
+ # Note: We should be calculating the relevance based on all
# comments for a bug, not just matching comments, but that's hard
# (see http://bugzilla.mozilla.org/show_bug.cgi?id=145588#c35).
- my $select_term = "(SUM($term1)/COUNT(${table}.comment_id)"
- . " + $term2_select) AS relevance";
+ my $select_term = "(SUM($term1) + $term2_select) AS relevance";
# add the column not used in aggregate function explicitly
push(@groupby, 'bugs.short_desc');