Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
7b6d4bdc
Commit
7b6d4bdc
authored
Jul 01, 2008
by
mkanat%bugzilla.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 432601: [Oracle] Fix 'Find a specific Bug' (fulltext searching)
Patch By Xiaoou Wu <xiaoou.wu@oracle.com> r=mkanat, a=mkanat
parent
d0112616
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
+10
-6
Oracle.pm
Bugzilla/DB/Oracle.pm
+2
-2
Search.pm
Bugzilla/Search.pm
+8
-4
No files found.
Bugzilla/DB/Oracle.pm
View file @
7b6d4bdc
...
@@ -146,10 +146,10 @@ sub sql_from_days{
...
@@ -146,10 +146,10 @@ sub sql_from_days{
return
" TO_DATE($date,'J') "
;
return
" TO_DATE($date,'J') "
;
}
}
sub
sql_fulltext_search
{
sub
sql_fulltext_search
{
my
(
$self
,
$column
,
$text
)
=
@_
;
my
(
$self
,
$column
,
$text
,
$label
)
=
@_
;
$text
=
$self
->
quote
(
$text
);
$text
=
$self
->
quote
(
$text
);
trick_taint
(
$text
);
trick_taint
(
$text
);
return
"CONTAINS($column,$text)"
;
return
"CONTAINS($column,$text
,$label)"
,
"SCORE($label
)"
;
}
}
sub
sql_date_format
{
sub
sql_date_format
{
...
...
Bugzilla/Search.pm
View file @
7b6d4bdc
...
@@ -1239,16 +1239,20 @@ sub _content_matches {
...
@@ -1239,16 +1239,20 @@ sub _content_matches {
"ON bugs.bug_id = $table.bug_id"
);
"ON bugs.bug_id = $table.bug_id"
);
# Create search terms to add to the SELECT and WHERE clauses.
# Create search terms to add to the SELECT and WHERE clauses.
my
$term1
=
$dbh
->
sql_fulltext_search
(
"$table.$comments_col"
,
$$v
);
my
(
$term1
,
$rterm1
)
=
$dbh
->
sql_fulltext_search
(
"$table.$comments_col"
,
my
$term2
=
$dbh
->
sql_fulltext_search
(
"$table.short_desc"
,
$$v
);
$$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.
# The term to use in the WHERE clause.
$$term
=
"$term1 > 0 OR $term2 > 0"
;
$$term
=
"$term1 > 0 OR $term2 > 0"
;
# In order to sort by relevance (in case the user requests it),
# 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
# 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.
# 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 + $r
term2) AS relevance"
;
# Users can specify to display the relevance field, in which case
# 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
# it'll show up in the list of fields being selected, and we need
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment