Current Behavior
When using Flarum-based sites in Chinese, searching for Chinese strings often fails to yield the expected results, thereby impacting the user experience. Existing search functionality is largely optimized for English, with significant shortcomings regarding Chinese text segmentation, indexing, and compatibility.
Steps to Reproduce
Install a fresh Flarum instance with the default search driver and a MySQL/MariaDB database.
Create a discussion with a Chinese title and body, for example:
Title: Flarum 中文搜索测试
Content: 这是一篇用于测试中文关键词搜索功能的帖子。
Ensure the discussion is visible to the test user and has been indexed normally.
Open the Flarum search box.
Search for Chinese keywords contained in the discussion, such as:
中文
搜索
关键词
中文搜索测试
Compare the result with an English keyword search in another discussion containing a matching English word.
Expected Behavior
Accurately retrieves post titles and content containing Chinese text.
The search function is optimized for Chinese word segmentation, returning results that align more closely with the query text.
Screenshots
No response
Environment
- Flarum version: 2.0.0-rc.5
- Website URL: http://localhost
- Webserver: apache
- Hosting environment: vps
- PHP version: 8.3
- Browser: chrome 151
Output of php flarum info
Possible Solution
Flarum should provide official CJK-aware search support—such as configurable MySQL ngram indexing or a supported external search driver—so Chinese, Japanese, and Korean content can be reliably searched without manual database modifications.
Additional Context
No response
Current Behavior
When using Flarum-based sites in Chinese, searching for Chinese strings often fails to yield the expected results, thereby impacting the user experience. Existing search functionality is largely optimized for English, with significant shortcomings regarding Chinese text segmentation, indexing, and compatibility.
Steps to Reproduce
Install a fresh Flarum instance with the default search driver and a MySQL/MariaDB database.
Create a discussion with a Chinese title and body, for example:
Title: Flarum 中文搜索测试
Content: 这是一篇用于测试中文关键词搜索功能的帖子。
Ensure the discussion is visible to the test user and has been indexed normally.
Open the Flarum search box.
Search for Chinese keywords contained in the discussion, such as:
中文
搜索
关键词
中文搜索测试
Compare the result with an English keyword search in another discussion containing a matching English word.
Expected Behavior
Accurately retrieves post titles and content containing Chinese text.
The search function is optimized for Chinese word segmentation, returning results that align more closely with the query text.
Screenshots
No response
Environment
Output of
php flarum infoPossible Solution
Flarum should provide official CJK-aware search support—such as configurable MySQL
ngramindexing or a supported external search driver—so Chinese, Japanese, and Korean content can be reliably searched without manual database modifications.Additional Context
No response