diff options
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/fulltext.result | 37 | ||||
-rw-r--r-- | mysql-test/t/fulltext.test | 15 |
2 files changed, 46 insertions, 6 deletions
diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index 6d17261b227..733710504c6 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -1,6 +1,10 @@ drop table if exists t1,t2,t3; CREATE TABLE t1 (a VARCHAR(200), b TEXT, FULLTEXT (a,b)); -INSERT INTO t1 VALUES('MySQL has now support', 'for full-text search'),('Full-text indexes', 'are called collections'),('Only MyISAM tables','support collections'),('Function MATCH ... AGAINST()','is used to do a search'),('Full-text search in MySQL', 'implements vector space model'); +INSERT INTO t1 VALUES('MySQL has now support', 'for full-text search'), +('Full-text indexes', 'are called collections'), +('Only MyISAM tables','support collections'), +('Function MATCH ... AGAINST()','is used to do a search'), +('Full-text search in MySQL', 'implements vector space model'); select * from t1 where MATCH(a,b) AGAINST ("collections"); a b Only MyISAM tables support collections @@ -12,6 +16,35 @@ select * from t1 where MATCH(a,b) AGAINST ("indexes collections"); a b Full-text indexes are called collections Only MyISAM tables support collections +select * from t1 where MATCH(a,b) AGAINST("support -collections" IN BOOLEAN MODE); +a b +MySQL has now support for full-text search +select * from t1 where MATCH(a,b) AGAINST("support collections" IN BOOLEAN MODE); +a b +MySQL has now support for full-text search +Full-text indexes are called collections +Only MyISAM tables support collections +select * from t1 where MATCH(a,b) AGAINST("support +collections" IN BOOLEAN MODE); +a b +Full-text indexes are called collections +Only MyISAM tables support collections +select * from t1 where MATCH(a,b) AGAINST("sear*" IN BOOLEAN MODE); +a b +MySQL has now support for full-text search +Function MATCH ... AGAINST() is used to do a search +Full-text search in MySQL implements vector space model +select * from t1 where MATCH(a,b) AGAINST("+support +collections" IN BOOLEAN MODE); +a b +Only MyISAM tables support collections +select * from t1 where MATCH(a,b) AGAINST("+search" IN BOOLEAN MODE); +a b +MySQL has now support for full-text search +Function MATCH ... AGAINST() is used to do a search +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 +MySQL has now support for full-text search +Full-text search in MySQL implements vector space model delete from t1 where a like "MySQL%"; drop table t1; CREATE TABLE t1 ( @@ -71,8 +104,6 @@ fulltext index tix (inhalt) ); select * from t2 where MATCH inhalt AGAINST (t2.inhalt); Wrong arguments to AGAINST -select * from t2 where MATCH inhalt AGAINST (t2.inhalt); -Wrong arguments to AGAINST select * from t2 where MATCH ticket AGAINST ('foobar'); Can't find FULLTEXT index matching the column list select * from t2,t3 where MATCH (t2.inhalt,t3.inhalt) AGAINST ('foobar'); diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test index e9b9bd23398..16b19381be4 100644 --- a/mysql-test/t/fulltext.test +++ b/mysql-test/t/fulltext.test @@ -5,10 +5,21 @@ drop table if exists t1,t2,t3; CREATE TABLE t1 (a VARCHAR(200), b TEXT, FULLTEXT (a,b)); -INSERT INTO t1 VALUES('MySQL has now support', 'for full-text search'),('Full-text indexes', 'are called collections'),('Only MyISAM tables','support collections'),('Function MATCH ... AGAINST()','is used to do a search'),('Full-text search in MySQL', 'implements vector space model'); +INSERT INTO t1 VALUES('MySQL has now support', 'for full-text search'), + ('Full-text indexes', 'are called collections'), + ('Only MyISAM tables','support collections'), + ('Function MATCH ... AGAINST()','is used to do a search'), + ('Full-text search in MySQL', 'implements vector space model'); select * from t1 where MATCH(a,b) AGAINST ("collections"); select * from t1 where MATCH(a,b) AGAINST ("indexes"); select * from t1 where MATCH(a,b) AGAINST ("indexes collections"); +select * from t1 where MATCH(a,b) AGAINST("support -collections" IN BOOLEAN MODE); +select * from t1 where MATCH(a,b) AGAINST("support collections" IN BOOLEAN MODE); +select * from t1 where MATCH(a,b) AGAINST("support +collections" IN BOOLEAN MODE); +select * from t1 where MATCH(a,b) AGAINST("sear*" IN BOOLEAN MODE); +select * from t1 where MATCH(a,b) AGAINST("+support +collections" IN BOOLEAN MODE); +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); delete from t1 where a like "MySQL%"; drop table t1; @@ -74,8 +85,6 @@ CREATE TABLE t3 ( --error 1210 select * from t2 where MATCH inhalt AGAINST (t2.inhalt); ---error 1210 -select * from t2 where MATCH inhalt AGAINST (t2.inhalt); --error 1191 select * from t2 where MATCH ticket AGAINST ('foobar'); --error 1210 |