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
4518c70b
Commit
4518c70b
authored
Jul 22, 2010
by
Max Kanat-Alexander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 578494: When doing a QuickSearch on a phrase, pass the phrase quoted
to the fulltext engine, so that it knows it's a phrase. r=LpSolit, a=mkanat
parent
b1fa012b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
DB.pm
Bugzilla/DB.pm
+4
-2
Quicksearch.pm
Bugzilla/Search/Quicksearch.pm
+9
-2
No files found.
Bugzilla/DB.pm
View file @
4518c70b
...
...
@@ -45,6 +45,7 @@ use Bugzilla::DB::Schema;
use
List::
Util
qw(max)
;
use
Storable
qw(dclone)
;
use
Text::
ParseWords
qw(shellwords)
;
#####################################################################
# Constants
...
...
@@ -383,8 +384,9 @@ sub sql_fulltext_search {
# make the string lowercase to do case insensitive search
my
$lower_text
=
lc
(
$text
);
# split the text we search for into separate words
my
@words
=
split
(
/\s+/
,
$lower_text
);
# split the text we're searching for into separate words, understanding
# quotes.
my
@words
=
shellwords
(
$lower_text
);
# surround the words with wildcards and SQL quotes so we can use them
# in LIKE search clauses
...
...
Bugzilla/Search/Quicksearch.pm
View file @
4518c70b
...
...
@@ -310,7 +310,7 @@ sub _handle_special_first_chars {
if
(
$firstChar
eq
'#'
)
{
addChart
(
'short_desc'
,
'substring'
,
$baseWord
,
$negate
);
addChart
(
'content'
,
'matches'
,
$baseWord
,
$negate
);
addChart
(
'content'
,
'matches'
,
_matches_phrase
(
$baseWord
)
,
$negate
);
return
1
;
}
if
(
$firstChar
eq
':'
)
{
...
...
@@ -470,7 +470,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'
,
$word
,
$negate
);
addChart
(
'content'
,
'matches'
,
_matches_phrase
(
$word
)
,
$negate
);
}
sub
_handle_urls
{
...
...
@@ -522,6 +522,13 @@ sub splitString {
return
@parts
;
}
# Quote and escape a phrase appropriately for a "content matches" search.
sub
_matches_phrase
{
my
(
$phrase
)
=
@_
;
$phrase
=~
s/"/\\"/g
;
return
"\"$phrase\""
;
}
# Expand found prefixes to states or resolutions
sub
matchPrefixes
{
my
$hr_states
=
shift
;
...
...
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