Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
859304f7
Commit
859304f7
authored
Jul 11, 2007
by
serg@janus.mylan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix for smarter index mergein fulltext
to work for queries like "+a (b)"
parent
05a12b7b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
6 deletions
+23
-6
mysql-test/r/fulltext.result
mysql-test/r/fulltext.result
+3
-0
mysql-test/t/fulltext.test
mysql-test/t/fulltext.test
+1
-0
storage/myisam/ft_boolean_search.c
storage/myisam/ft_boolean_search.c
+19
-6
No files found.
mysql-test/r/fulltext.result
View file @
859304f7
...
...
@@ -485,4 +485,7 @@ INSERT INTO t1 VALUES('Offside'),('City Of God');
SELECT a FROM t1 WHERE MATCH a AGAINST ('+city of*' IN BOOLEAN MODE);
a
City Of God
SELECT a FROM t1 WHERE MATCH a AGAINST ('+city (of)*' IN BOOLEAN MODE);
a
City Of God
DROP TABLE t1;
mysql-test/t/fulltext.test
View file @
859304f7
...
...
@@ -414,6 +414,7 @@ DROP TABLE t1;
CREATE
TABLE
t1
(
a
VARCHAR
(
20
),
FULLTEXT
(
a
));
INSERT
INTO
t1
VALUES
(
'Offside'
),(
'City Of God'
);
SELECT
a
FROM
t1
WHERE
MATCH
a
AGAINST
(
'+city of*'
IN
BOOLEAN
MODE
);
SELECT
a
FROM
t1
WHERE
MATCH
a
AGAINST
(
'+city (of)*'
IN
BOOLEAN
MODE
);
DROP
TABLE
t1
;
# End of 4.1 tests
storage/myisam/ft_boolean_search.c
View file @
859304f7
...
...
@@ -24,7 +24,7 @@
subtree, but it could be updated by plus-word only.
The idea is: there is no need to search for docid smaller than
biggest docid inside current plus subtree.
biggest docid inside current plus subtree
or any upper plus subtree
.
Examples:
+word1 word2
...
...
@@ -36,6 +36,13 @@
+(word1 -word2) +(+word3 word4)
share same max_docid
max_docid updated by word3
+word1 word2 (+word3 word4 (+word5 word6))
three subexpressions (including the top-level one),
every one has its own max_docid, updated by its plus word.
but for the search word6 uses
max(word1.max_docid, word3.max_docid, word5.max_docid),
while word4 uses, accordingly,
max(word1.max_docid, word3.max_docid).
*/
#define FT_CORE
...
...
@@ -104,7 +111,7 @@ typedef struct st_ftb_word
/* ^^^^^^^^^^^^^^^^^^ FTB_{EXPR,WORD} common section */
my_off_t
docid
[
2
];
/* for index search and for scan */
my_off_t
key_root
;
my_off_t
*
max_docid
;
FTB_EXPR
*
max_docid_expr
;
MI_KEYDEF
*
keyinfo
;
struct
st_ftb_word
*
prev
;
float
weight
;
...
...
@@ -208,7 +215,7 @@ static int ftb_query_add_word(MYSQL_FTPARSER_PARAM *param,
for
(
tmp_expr
=
ftb_param
->
ftbe
;
tmp_expr
->
up
;
tmp_expr
=
tmp_expr
->
up
)
if
(
!
(
tmp_expr
->
flags
&
FTB_FLAG_YES
))
break
;
ftbw
->
max_docid
=
&
tmp_expr
->
max_docid
;
ftbw
->
max_docid
_expr
=
tmp_expr
;
/* fall through */
case
FT_TOKEN_STOPWORD
:
if
(
!
ftb_param
->
up_quot
)
break
;
...
...
@@ -347,11 +354,17 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
else
{
uint
sflag
=
SEARCH_BIGGER
;
if
(
ftbw
->
docid
[
0
]
<
*
ftbw
->
max_docid
)
my_off_t
max_docid
=
0
;
FTB_EXPR
*
tmp
;
for
(
tmp
=
ftbw
->
max_docid_expr
;
tmp
;
tmp
=
tmp
->
up
)
set_if_bigger
(
max_docid
,
tmp
->
max_docid
);
if
(
ftbw
->
docid
[
0
]
<
max_docid
)
{
sflag
|=
SEARCH_SAME
;
_mi_dpointer
(
info
,
(
uchar
*
)(
ftbw
->
word
+
ftbw
->
len
+
HA_FT_WLEN
),
*
ftbw
->
max_docid
);
max_docid
);
}
r
=
_mi_search
(
info
,
ftbw
->
keyinfo
,
(
uchar
*
)
lastkey_buf
,
USE_WHOLE_KEY
,
sflag
,
ftbw
->
key_root
);
...
...
@@ -431,7 +444,7 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
}
ftbw
->
docid
[
0
]
=
info
->
lastpos
;
if
(
ftbw
->
flags
&
FTB_FLAG_YES
)
*
ftbw
->
max_docid
=
info
->
lastpos
;
ftbw
->
max_docid_expr
->
max_docid
=
info
->
lastpos
;
return
0
;
}
...
...
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