使用3个字母的单词在mysql上进行全文搜索

Pon*_*ons 9 mysql search full-text-search

我想在包含"The Zen Circus"的字段中找到"禅"字符串.我有一个FULLTEXT索引.

select url,name,
,   MATCH(name) AGAINST ( 'zen*' IN BOOLEAN MODE) as A
,   MATCH(name) AGAINST ( '"the zen*"' IN BOOLEAN MODE) as B
,   MATCH(name) AGAINST ('>the* zen' IN BOOLEAN MODE) as C
,   MATCH(name) AGAINST ('thezen*' IN BOOLEAN MODE) as D
,   MATCH(name) AGAINST ('cir*' IN BOOLEAN MODE) as E
,   MATCH(name) AGAINST ('circus*' IN BOOLEAN MODE) as F
from pages where url='thezencircus'
Run Code Online (Sandbox Code Playgroud)

我有这个结果:

url = thezencircus
name = The Zen Circus
A = 0   (why?)
B = 0   (why?)
C = 0   (why?)
D = 0   (ok)
E = 1   (ok)
F = 1   (ok)
Run Code Online (Sandbox Code Playgroud)

我还在msyql配置文件中放了ft_min_word_len = 2.

任何的想法?

Kao*_*Kao 10

查看此答案MySQL全文搜索三个或更少字母的单词

[mysqld]
ft_min_word_len = 3
然后,您必须重新启动服务器并重建FULLTEXT索引.

记得重新启动并重建索引.


编辑
"运行" show variables like 'ft_%';以确认字长与您设置的字长相匹配.