
ngram_token_size 设置为 1
CREATE TABLE articles ( id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, title VARCHAR(200), FULLTEXT (title) WITH PARSER ngram ) ENGINE=InnoDB CHARACTER SET utf8mb4; INSERT INTO articles (title) VALUES("a"); INSERT INTO articles (title) VALUES("b"); INSERT INTO articles (title) VALUES("f"); 搜索 a,返回空。为什么?
select * FROM articles WHERE MATCH (title) AGAINST ('+a' IN BOOLEAN MODE) ; ps, 把 a 改成 b 或者 f 则能正常返回。
1 aliipay OP up,这么久没人回 |
2 kaffka 2020-03-13 22:45:04 +08:00 测试了下 1238 - Variable 'ngram_token_size' is a read only variable, Time: 0.001000s 默认是 2 很好奇你是怎么设置的 |
4 sakaf 2020-05-29 11:41:30 +08:00 后面解决了吗,遇到同样的问题= = |
6 sakaf 2020-05-29 14:18:29 +08:00 谢谢大佬 |