Skip to content

Chinese/CJK character search in Flarum is not user-friendly and lacks effective support for Chinese word segmentation. #4914

Description

@ygpynet

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions