Flarum beta9 中文搜索优化
MySQL 自 5.7 开始支持 FULLTEXT 中文搜寻,重建索引即可
修改 mysql.cnf,加入:
[mysqld]
ngram_token_size=2
修改后需要重建 FULLTEXT 索引
ALTER TABLE flarum_posts DROP INDEX content;
CREATE FULLTEXT INDEX content ON `flarum_posts` (`content`) WITH PARSER ngram;
ALTER TABLE flarum_discussions DROP INDEX title;
CREATE FULLTEXT INDEX title ON `flarum_discussions` (`title`) WITH PARSER ngram;
网友评论