----- Original Message ----- From: "Kapoor, Nishikant" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, August 30, 2004 2:41 PM Subject: very simple query but strange results
This little sql has me puzzled. Would appreciate your help. mysql> drop table if exists T; Query OK, 0 rows affected (0.00 sec) mysql> create table T (title text, fulltext(title)) type=MyISAM; Query OK, 0 rows affected (0.00 sec) mysql> insert into T values ('01 test'), ('test resource'); Query OK, 2 rows affected (0.00 sec) Records: 2 Duplicates: 0 Warnings: 0 mysql> -- not working!!!! mysql> SELECT title FROM T WHERE MATCH(title) AGAINST ('test'); Empty set (0.00 sec) Why 'Empty set'? I expect to see two rows. What am I missing? Thanks Nishi mysqladmin Ver 8.40 Distrib 4.0.15, for mandrake-linux-gnu on i586 Server version 4.0.15 Protocol version 10 ---------------------------------------------------------------------------- ---------------------------------------- I'm not sure. I haven't worked with fulltext searches myself but your question intrigued me. I tried creating the same table you did and then ran the same query: I had the same result you did. I went to this page of the MySQL manual http://dev.mysql.com/doc/mysql/en/Fulltext_Search.html, but couldn't see any obvious error in your query based on the rules I saw there. I tried setting up the table that they used in their examples and it gave the same result that they predicted. The big difference between your example and theirs was that their example had the fulltext() function applied to TWO columns, title and body, while yours applied only to title. I wonder if there is an unstated rule that the match() function must always be used against at least two columns? That strikes me as a very odd design for a function so it doesn't seem likely. However, I am at a loss to suggest another explanation. Perhaps someone with more experience with MATCH() or one of the MySQL developers could enlighten us on the correct technique for searching a single fulltext column. Rhino -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]