Commit 6052c856 authored by serg@sergbook.mysql.com's avatar serg@sergbook.mysql.com

Merge

parents e68ebac9 8667b0a2
...@@ -49215,6 +49215,9 @@ Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}. ...@@ -49215,6 +49215,9 @@ Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}.
@itemize @bullet @itemize @bullet
@item @item
Fixed bug in truncation operator of boolean fulltext search (wrong results
when there are only @code{+word*}'s in the query).
@item
Fixed bug in DROP DATABASE with symlink Fixed bug in DROP DATABASE with symlink
@item @item
Fixed bug in EXPLAIN with LIMIT offset != 0 Fixed bug in EXPLAIN with LIMIT offset != 0
...@@ -200,25 +200,31 @@ void _ftb_init_index_search(FT_INFO *ftb) ...@@ -200,25 +200,31 @@ void _ftb_init_index_search(FT_INFO *ftb)
{ {
ftbw=(FTB_WORD *)(ftb->queue.root[i]); ftbw=(FTB_WORD *)(ftb->queue.root[i]);
if (ftbw->flags&FTB_FLAG_TRUNC) /* special treatment :(( */ if (ftbw->flags&FTB_FLAG_TRUNC)
if (ftbw->up->ythresh > test(ftbw->flags&FTB_FLAG_YES)) /* special treatment for truncation operator :((
1. +trunc* and there're other (not +trunc*) words
| no need to search in the index, it can never ADD new rows
| to the result, and to remove half-matched rows we do scan anyway
2. -trunc*
| same as 1.
3. trunc*
| We have to index-search for this prefix.
| It may cause duplicates, as in the index (sorted by <word,docid>)
| <aaaa,row1>
| <aabb,row2>
| <aacc,row1>
| Searching for "aa*" will find row1 twice...
*/
if ( test(ftbw->flags&FTB_FLAG_NO) || /* 2 */
(test(ftbw->flags&FTB_FLAG_YES) && /* 1 */
ftbw->up->ythresh - ftbw->up->yweaks >1)) /* 1 */
{ {
/* no need to search for this prefix in the index -
* it cannot ADD new matches, and to REMOVE half-matched
* rows we do scan anyway */
ftbw->docid[0]=HA_POS_ERROR; ftbw->docid[0]=HA_POS_ERROR;
ftbw->up->yweaks++; ftbw->up->yweaks++;
continue; continue;
} }
else else /* 3 */
{ {
/* We have to index-search for this prefix.
* It may cause duplicates, as in the index (sorted by <word,docid>)
* <aaaa,row1>
* <aabb,row2>
* <aacc,row1>
* Searching for "aa*" will find row1 twice...
*/
if (!is_tree_inited(& ftb->no_dupes)) if (!is_tree_inited(& ftb->no_dupes))
{ {
init_tree(& ftb->no_dupes,0,0,sizeof(my_off_t), init_tree(& ftb->no_dupes,0,0,sizeof(my_off_t),
......
...@@ -67,6 +67,9 @@ Full-text indexes are called collections 1 ...@@ -67,6 +67,9 @@ Full-text indexes are called collections 1
Only MyISAM tables support collections 2 Only MyISAM tables support collections 2
Function MATCH ... AGAINST() is used to do a search 0 Function MATCH ... AGAINST() is used to do a search 0
Full-text search in MySQL implements vector space model 0 Full-text search in MySQL implements vector space model 0
select * from t1 where MATCH a,b AGAINST ("+call* +coll*" IN BOOLEAN MODE);
a b
Full-text indexes are called collections
select * from t1 where MATCH a,b AGAINST ('"Now sUPPort"' IN BOOLEAN MODE); select * from t1 where MATCH a,b AGAINST ('"Now sUPPort"' IN BOOLEAN MODE);
a b a b
MySQL has now support for full-text search MySQL has now support for full-text search
......
...@@ -33,6 +33,8 @@ select * from t1 where MATCH(a,b) AGAINST("+search -(support vector)" IN BOOLEAN ...@@ -33,6 +33,8 @@ select * from t1 where MATCH(a,b) AGAINST("+search -(support vector)" IN BOOLEAN
select *, MATCH(a,b) AGAINST("support collections" IN BOOLEAN MODE) as x from t1; select *, MATCH(a,b) AGAINST("support collections" IN BOOLEAN MODE) as x from t1;
select *, MATCH(a,b) AGAINST("collections support" IN BOOLEAN MODE) as x from t1; select *, MATCH(a,b) AGAINST("collections support" IN BOOLEAN MODE) as x from t1;
select * from t1 where MATCH a,b AGAINST ("+call* +coll*" IN BOOLEAN MODE);
select * from t1 where MATCH a,b AGAINST ('"Now sUPPort"' IN BOOLEAN MODE); select * from t1 where MATCH a,b AGAINST ('"Now sUPPort"' IN BOOLEAN MODE);
select * from t1 where MATCH a,b AGAINST ('"text search" "now support"' IN BOOLEAN MODE); select * from t1 where MATCH a,b AGAINST ('"text search" "now support"' IN BOOLEAN MODE);
select * from t1 where MATCH a,b AGAINST ('"text search" -"now support"' IN BOOLEAN MODE); select * from t1 where MATCH a,b AGAINST ('"text search" -"now support"' IN BOOLEAN MODE);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment