Flarum itself is quite unfriendly toward Chinese. As the versions have evolved, it has gradually begun optimizing its support for Chinese, such as supporting Chinese username registration, which is indeed quite useful. However, the latest beta11 version still does not support searching Chinese content. Fortunately, MySQL has supported full-text indexing for Chinese and Japanese since version 5.7.

In addition, Flarum developers have also said that future versions will use the ElasticSearch distributed full-text search engine, because ElasticSearch is better than this method. However, it has still not been implemented. Please note that this method will affect database performance to some extent.

Method

Modify mysql.cnf and add:

[mysqld]
ngram_token_size=2

After making the modification, the FULLTEXT indexes need to be rebuilt:

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;

After rebuilding them, clear the cache in the Flarum administration panel, and you will be able to search Chinese content, including article titles and article content.

Search Chinese content