From 9fdd88e1f3fc9553c2e74a661523d5c4830b3433 Mon Sep 17 00:00:00 2001 From: "serg@serg.mysql.com" <> Date: Thu, 8 Nov 2001 00:06:07 +0100 Subject: [PATCH 1/3] bug in relevance calculation fixed --- myisam/ft_boolean_search.c | 3 +-- mysql-test/r/fulltext.result | 7 +++++++ mysql-test/t/fulltext.test | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c index bda76cb09a8..49b861fe22d 100644 --- a/myisam/ft_boolean_search.c +++ b/myisam/ft_boolean_search.c @@ -260,15 +260,14 @@ void _ftb_climb_the_tree(FTB_WORD *ftbw, my_off_t curdoc) else /* if (yn==0) */ { + ftbe->cur_weight+=weight; if (ftbe->yesses >= ftbe->ythresh && !ftbe->nos) { yn=ftbe->yesno; - ftbe->cur_weight=weight; weight*=ftbe->weight; } else { - ftbe->cur_weight+=weight; break; } } diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index c2b4de5f439..dbc0ac09f31 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -48,6 +48,13 @@ Full-text search in MySQL implements vector space model select * from t1 where MATCH(a,b) AGAINST("+search -(support vector)" IN BOOLEAN MODE); a b Function MATCH ... AGAINST() is used to do a search +select *, MATCH(a,b) AGAINST("support collections" IN BOOLEAN MODE) as x from t1; +a b x +MySQL has now support for full-text search 1 +Full-text indexes are called collections 1 +Only MyISAM tables support collections 2 +Function MATCH ... AGAINST() is used to do a search 0 +Full-text search in MySQL implements vector space model 0 delete from t1 where a like "MySQL%"; drop table t1; CREATE TABLE t1 ( diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test index af58c747167..2608a9c02a6 100644 --- a/mysql-test/t/fulltext.test +++ b/mysql-test/t/fulltext.test @@ -21,6 +21,7 @@ select * from t1 where MATCH(a,b) AGAINST("+support +collections" IN BOOLEAN MOD select * from t1 where MATCH(a,b) AGAINST("+search" IN BOOLEAN MODE); select * from t1 where MATCH(a,b) AGAINST("+search +(support vector)" IN BOOLEAN MODE); select * from t1 where MATCH(a,b) AGAINST("+search -(support vector)" IN BOOLEAN MODE); +select *, MATCH(a,b) AGAINST("support collections" IN BOOLEAN MODE) as x from t1; delete from t1 where a like "MySQL%"; drop table t1; From b03a786ce51045d5a01b3c78fdf146643931dbfc Mon Sep 17 00:00:00 2001 From: "serg@serg.mysql.com" <> Date: Thu, 8 Nov 2001 00:14:16 +0100 Subject: [PATCH 2/3] POSIX.2 compatible fix --- BitKeeper/triggers/post-commit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BitKeeper/triggers/post-commit b/BitKeeper/triggers/post-commit index 64cb60936d4..275c278f29d 100755 --- a/BitKeeper/triggers/post-commit +++ b/BitKeeper/triggers/post-commit @@ -61,7 +61,7 @@ EOF # docs-commit@ mail #-- bk changes -v -r+ | grep -q Docs/manual.texi - if [ $? == 0 ] + if [ $? -eq 0 ] then echo "Notifying docs list at $DOCS" ( From 0674da3b2747db7d7b4553c741f94209846071e7 Mon Sep 17 00:00:00 2001 From: "serg@serg.mysql.com" <> Date: Thu, 8 Nov 2001 00:16:08 +0100 Subject: [PATCH 3/3] ft_boolean_search.c test --- myisam/ft_boolean_search.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c index 49b861fe22d..9f1a3325e7b 100644 --- a/myisam/ft_boolean_search.c +++ b/myisam/ft_boolean_search.c @@ -251,7 +251,7 @@ void _ftb_climb_the_tree(FTB_WORD *ftbw, my_off_t curdoc) { /* NOTE: special sort function of queue assures that all yn<0 * events for every particular subexpression will - * "auto-magically" happen BEFORE all yn>=0 events. So no + * "auto-magically" happen BEFORE all the yn>=0 events. So no * already matched expression can become not-matched again. */ ++ftbe->nos;