I skimmed the whole article twice, including the user comments, and still missed that :-(
Thanks for catching that Michael! That explanation makes a lot of sense, a lot more sense than forcing there to be at least two columns in the fulltext() column. Rhino ----- Original Message ----- From: "Michael Stassen" <[EMAIL PROTECTED]> To: "Rhino" <[EMAIL PROTECTED]> Cc: "Kapoor, Nishikant" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Monday, August 30, 2004 7:12 PM Subject: Re: very simple query but strange results > > Rhino wrote: > > > ----- 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 > > The answer is in the middle of that document. Words which appear in 50% or > more of your rows become stopwords, because they aren't very useful for > narrowing your search. One consequence is that you must have at least 3 > rows in a table before full-text indexing will find anything. Full-text > indexing is designed for large collections, not tiny test tables. > > Michael > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] > -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]