Today I answered to a problem regarding fulltext indexes on an
italian newsgroup. The guy was in trouble in building a
multicolumn fulltext index. MySQL always said that a column
cannot be part of the index. Why?
Remember that all the columns in a fulltext index must have
the same charset and the same collation.
Let’s try if it is true!
Create a sample news table and try to build the fulltext index on
(news_title, news_text):
mysql> CREATE TABLE news(
-> id INT auto_increment,
-> news_title VARCHAR(100),
-> news_text TEXT,
-> PRIMARY KEY(id))
-> CHARSET latin1 COLLATE latin1_general_ci;
Query OK, 0 rows affected (0.00 sec)
mysql> CREATE FULLTEXT INDEX ft_idx ON news(news_title,news_text);
Query OK, 0 rows affected (0.05 sec)
Records: 0 Duplicates: 0 Warnings: 0
Great, it works!
And now, change the charset of one of the field and try …
[Read more]