有这个表:
CREATE TABLE search (
`uid_search` INT(15) NOT NULL auto_increment,
`uid` INT(11),
`type` VARCHAR(30),
`strings` TEXT,
UNIQUE (uid,type),
PRIMARY KEY (uid_search),
FULLTEXT (strings) ) ENGINE=MyISAM
DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci
并插入此数据:
INSERT INTO `search` (`uid_search`, `uid`, `type`, `strings`)
VALUES (1, 2, 'doc', 'Formación Primeros Auxilios');
为什么这些查询都不匹配全文搜索?
SELECT uid, type, strings, MATCH (strings) AGAINST ('Formación' IN NATURAL LANGUAGE MODE) as matches FROM search
SELECT uid, type, strings, MATCH (strings) AGAINST (CONVERT(_utf8'Formación' USING latin1) IN NATURAL LANGUAGE MODE) as matches FROM agd_tmp.search
我认为UTF8有问题。