FULLTEXT search in MySQL does not return any rows

Viewed 5843

I am a bit lost, this looks like some silly mistake - but I have no clue what that can be. Here is the test session:

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)

This is on "mysqld Ver 5.1.37-1ubuntu5 for debian-linux-gnu on i486 ((Ubuntu))".

Here is the script for simple cut and paste (please try it and verify if it works on your system):

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');     
2 Answers
Related