Forum Moderators: open

Message Too Old, No Replies

MySQL fulltext stopword list

setting is ignored

         

RonPK

10:38 am on Jun 21, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I added this line to my.cnf in order to have MySQL (5.0.27) ignore it's built-in stopword list:

ft_stopword_file = ''

Just like it says in the manual [dev.mysql.com]. Restarted the server, rebuilt the index. But somehow a query like

SELECT * FROM table WHERE MATCH column AGAINST ('and')

still returns 0 results. The word does exist, and I've set ft_min_word_len to 3, so there really should be results.

Any clue on what I'm doing wrong?

vincevincevince

10:52 am on Jun 21, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is 'and' still a very common word? If most of your rows contain 'and' then you won't match it.

Add 10 rows without 'and' and one row with 'and' and it should work fine...

RonPK

11:26 am on Jun 21, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks vince, back to the manual for me! I made a test table with records like you suggested, and that worked just fine.

I've been getting mail from people complaining that searching for words like the and and doesn't seem to work. Changing the text is not an option, so I'll need to find a workaround. After all, if two users bother to complain, two thousand might be annoyed.

vincevincevince

11:48 am on Jun 21, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I use a fallback for that kind of thing - if there are no results, then I run the query again with LIKE '%string%' instead of MATCH AGAINST