简体   繁体   中英

MySQL fulltext search with no matches


Having this table:

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

And inserting this data:

INSERT INTO `search` (`uid_search`, `uid`, `type`, `strings`) 
VALUES (1, 2, 'doc', 'Formación Primeros Auxilios');

Why none of this queries match the fulltext search?

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

I thinks something is wrong with UTF8.

Quoting the manual :

In addition, words that are present in 50% or more of the rows are considered common and do not match.

You need to insert more rows into your table.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM