2001-09-28 07:05:54 +02:00
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
a INT AUTO_INCREMENT PRIMARY KEY,
message CHAR(20),
FULLTEXT(message)
) comment = 'original testcase by sroussey@network54.com';
INSERT INTO t1 (message) VALUES ("Testing"),("table"),("testbug"),
("steve"),("is"),("cool"),("steve is cool");
SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE MATCH (message) AGAINST ('steve');
2000-12-30 16:50:18 +01:00
a MATCH (message) AGAINST ('steve')
2001-10-12 19:10:11 +02:00
4 0.90587323904037
7 0.89568990468979
2001-11-22 16:00:11 +01:00
SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE MATCH (message) AGAINST ('steve');
a MATCH (message) AGAINST ('steve' IN BOOLEAN MODE)
4 1
7 1
SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE MATCH (message) AGAINST ('steve' IN BOOLEAN MODE);
a MATCH (message) AGAINST ('steve')
4 0.90587323904037
7 0.89568990468979
SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE MATCH (message) AGAINST ('steve' IN BOOLEAN MODE);
a MATCH (message) AGAINST ('steve' IN BOOLEAN MODE)
4 1
7 1
2001-09-28 07:05:54 +02:00
SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE MATCH (message) AGAINST ('steve') ORDER BY a;
2000-12-30 16:50:18 +01:00
a MATCH (message) AGAINST ('steve')
2001-10-12 19:10:11 +02:00
4 0.90587323904037
7 0.89568990468979
2001-11-22 16:00:11 +01:00
SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) ORDER BY a;
a MATCH (message) AGAINST ('steve' IN BOOLEAN MODE)
4 1
7 1
2001-09-28 07:05:54 +02:00
SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE a in (2,7,4) and MATCH (message) AGAINST ('steve') ORDER BY a DESC;
2000-12-30 16:50:18 +01:00
a MATCH (message) AGAINST ('steve')
2001-10-12 19:10:11 +02:00
7 0.89568990468979
4 0.90587323904037
2001-11-22 16:00:11 +01:00
SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE a in (2,7,4) and MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) ORDER BY a DESC;
a MATCH (message) AGAINST ('steve' IN BOOLEAN MODE)
7 1
4 1
2001-09-28 07:05:54 +02:00
SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE a=7 and MATCH (message) AGAINST ('steve') ORDER BY 1;
2000-12-30 16:50:18 +01:00
a MATCH (message) AGAINST ('steve')
2001-10-12 19:10:11 +02:00
7 0.89568990468979
2001-11-22 16:00:11 +01:00
SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE a=7 and MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) ORDER BY 1;
a MATCH (message) AGAINST ('steve' IN BOOLEAN MODE)
7 1
2001-09-28 07:05:54 +02:00
SELECT a, MATCH (message) AGAINST ('steve') as rel FROM t1 ORDER BY rel;
2000-12-30 16:50:18 +01:00
a rel
1 0
2 0
3 0
5 0
6 0
2001-10-12 19:10:11 +02:00
7 0.89568990468979
4 0.90587323904037
2001-11-22 16:00:11 +01:00
SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) as rel FROM t1 ORDER BY rel;
a rel
1 0
2 0
3 0
5 0
6 0
4 1
7 1
2001-09-28 07:05:54 +02:00
drop table t1;
2002-09-17 21:04:10 +02:00
CREATE TABLE t1 (
a INT AUTO_INCREMENT PRIMARY KEY,
message CHAR(20),
FULLTEXT(message)
);
INSERT INTO t1 (message) VALUES ("testbug"),("testbug foobar");
SELECT a, MATCH (message) AGAINST ('t* f*' IN BOOLEAN MODE) as rel FROM t1;
a rel
1 1
2 2
SELECT a, MATCH (message) AGAINST ('t* f*' IN BOOLEAN MODE) as rel FROM t1 ORDER BY rel,a;
a rel
1 1
2 2
drop table t1;