我有點失落,這看起來像一些愚蠢的錯誤 - 但我不知道可以。下面是測試環節:在MySQL中的FULLTEXT搜索不會返回任何行
mysql> drop table articles;
Query OK, 0 rows affected (0.02 sec)
mysql> CREATE TABLE articles (body TEXT, title VARCHAR(250), id INT NOT NULL auto_increment, PRIMARY KEY(id)) ENGINE = MYISAM;
Query OK, 0 rows affected (0.02 sec)
mysql> ALTER TABLE articles ADD FULLTEXT(body, title);
Query OK, 0 rows affected (0.02 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> insert into articles(body) values ('Maya');
Query OK, 1 row affected (0.00 sec)
mysql> SELECT * FROM articles WHERE MATCH(title, body) AGAINST('Maya');
Empty set (0.00 sec)
mysql> select * from articles
-> ;
+------+-------+----+
| body | title | id |
+------+-------+----+
| Maya | NULL | 1 |
+------+-------+----+
1 row in set (0.00 sec)
這是 「mysqld的版本5.1.37-1ubuntu5上的i486((Ubuntu的))Debian的Linux-GNU」。
下面是簡單的剪切和粘貼腳本(請嘗試,驗證它是否工作在系統上):中行的50%以上不匹配
CREATE TABLE articles (body TEXT, title VARCHAR(250), id INT NOT NULL auto_increment, PRIMARY KEY(id)) ENGINE = MYISAM;
ALTER TABLE articles ADD FULLTEXT(body, title);
insert into articles(body) values ('Maya');
SELECT * FROM articles WHERE MATCH(title, body) AGAINST('Maya');
+1詢問罰款,可以理解的,證據充分的問題上先走了。 – 2010-08-09 11:19:07