summaryrefslogtreecommitdiff
path: root/myisam/ft_boolean_search.c
diff options
context:
space:
mode:
authorunknown <serg@serg.mysql.com>2001-12-04 14:24:47 +0100
committerunknown <serg@serg.mysql.com>2001-12-04 14:24:47 +0100
commit1d55c88e08f7e77093156f82702dce1e79744793 (patch)
treeb361c6db483037085d6a868259f3bc9d97ec9a26 /myisam/ft_boolean_search.c
parenteb4c0fe7800c58a0b88e7f748fd42fdd9111d23b (diff)
downloadmariadb-git-1d55c88e08f7e77093156f82702dce1e79744793.tar.gz
ft_boolean_search.c bugfix "+(aaa bbb) +ccc"
ft_dump.c -l option - report word length distribution (for ft_max_word_len_for_sort) myisam/ft_boolean_search.c: bugfix "+(aaa bbb) +ccc" myisam/ft_dump.c: -l option - report word length distribution (for ft_max_word_len_for_sort)
Diffstat (limited to 'myisam/ft_boolean_search.c')
-rw-r--r--myisam/ft_boolean_search.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c
index 0055842c24b..fce6fee7c8d 100644
--- a/myisam/ft_boolean_search.c
+++ b/myisam/ft_boolean_search.c
@@ -239,10 +239,12 @@ void _ftb_climb_the_tree(FTB_WORD *ftbw, my_off_t curdoc)
ftbe->cur_weight=ftbe->yesses=ftbe->nos=0;
ftbe->docid=curdoc;
}
+ if (ftbe->nos)
+ break;
if (yn>0)
{
ftbe->cur_weight+=weight;
- if (++ftbe->yesses >= ftbe->ythresh && !ftbe->nos)
+ if (++ftbe->yesses == ftbe->ythresh)
{
yn=ftbe->yesno;
weight=ftbe->cur_weight*ftbe->weight;
@@ -265,15 +267,10 @@ void _ftb_climb_the_tree(FTB_WORD *ftbw, my_off_t curdoc)
/* if (yn==0) */
{
ftbe->cur_weight+=weight;
- if (ftbe->yesses >= ftbe->ythresh && !ftbe->nos)
- {
- yn=ftbe->yesno;
- weight*=ftbe->weight;
- }
- else
- {
+ if (ftbe->yesses < ftbe->ythresh)
break;
- }
+ yn= (ftbe->yesses++ == ftbe->ythresh) * ftbe->yesno;
+ weight*=ftbe->weight;
}
}
}