MySQL FULLTEXT aggravation

Posted by southof40 on Stack Overflow See other posts from Stack Overflow or by southof40
Published on 2010-05-20T21:54:52Z Indexed on 2010/05/21 0:10 UTC
Read the original article Hit count: 311

Filed under:
|
|

Hi - I'm having problems with case-sensitivity in MySQL FULLTEXT searches.

I've just followed the FULLTEXT example in the MySQL doco at http://dev.mysql.com/doc/refman/5.1/en/fulltext-boolean.html . I'll post it here for ease of reference ...

CREATE TABLE articles (
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
title VARCHAR(200),
body TEXT,
FULLTEXT (title,body)
);

INSERT INTO articles (title,body) VALUES
('MySQL Tutorial','DBMS stands for DataBase ...'),
('How To Use MySQL Well','After you went through a ...'),
('Optimizing MySQL','In this tutorial we will show ...'),
('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'),
('MySQL vs. YourSQL','In the following database comparison ...'),
('MySQL Security','When configured properly, MySQL ...');

SELECT * FROM articles
WHERE MATCH (title,body)
AGAINST ('database' IN NATURAL LANGUAGE MODE);

... my problem is that the example shows that SELECT returning the first and fifth rows ('..DataBase..' and '..database..') but I only get one row ('database') !

The example doesn't demonstrate what collation the table in the example had but I have ended up with latin1_general_cs on the title and body columns of my example table.

My version of MySQL is 5.1.39-log and the connection collation is utf8_unicode_ci .

I'd be really grateful is someone could suggest why my experience differs from the example in the manual !

Be grateful for any advice.

© Stack Overflow or respective owner

Related posts about mysql

Related posts about fulltext