diff options
author | unknown <serg@sergbook.mysql.com> | 2002-05-15 20:57:10 +0200 |
---|---|---|
committer | unknown <serg@sergbook.mysql.com> | 2002-05-15 20:57:10 +0200 |
commit | 69664dbf987d217db1918aa493706ccd0f5b739c (patch) | |
tree | 36632888c5a8fe3641b705533199d1f81775829f /myisam | |
parent | dc2b6e456fb16685a4191537bf83e1161cb28d93 (diff) | |
parent | 19eb09ae8a43ee910533acdfdc6985d3601fbf5a (diff) | |
download | mariadb-git-69664dbf987d217db1918aa493706ccd0f5b739c.tar.gz |
Merge
Docs/manual.texi:
SCCS merged
Diffstat (limited to 'myisam')
-rw-r--r-- | myisam/ft_boolean_search.c | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c index f78d2e3c05f..1b44f9d1ab9 100644 --- a/myisam/ft_boolean_search.c +++ b/myisam/ft_boolean_search.c @@ -200,25 +200,31 @@ void _ftb_init_index_search(FT_INFO *ftb) { ftbw=(FTB_WORD *)(ftb->queue.root[i]); - if (ftbw->flags&FTB_FLAG_TRUNC) /* special treatment :(( */ - if (ftbw->up->ythresh > test(ftbw->flags&FTB_FLAG_YES)) + if (ftbw->flags&FTB_FLAG_TRUNC) + /* 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->up->yweaks++; 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)) { init_tree(& ftb->no_dupes,0,0,sizeof(my_off_t), |