This guide explains how to adjust Discourse settings to better accommodate Chinese, Japanese, and Korean (CJK) languages in site search.
Required user level: Administrator
Discourse’s default settings may not be optimal for CJK (Chinese, Japanese, Korean) languages. This guide will walk you through the necessary adjustments to improve the user experience for CJK language users.
Summary
We’ll cover the following adjustments:
- Modifying search term length
- Allowing uppercase posts
- Adjusting minimum post and topic title lengths
- Setting appropriate entropy values
- Troubleshooting search issues
Adjusting site settings
To make these changes, navigate to your site’s admin panel and search for the following settings:
1. Minimum search term length
Set min_search_term_length
to 1 or 2.
CJK keywords can be as short as two characters, so it’s important to lower this value to allow for effective searching.
2. Allow uppercase posts
Enable the allow_uppercase_posts
setting.
Discourse may not recognize CJK characters when analyzing topics. Enabling this setting prevents users from encountering errors when creating post titles.
3. Minimum post length
Set min_post_length
to approximately 8.
This value provides a reasonable minimum length for sentences in CJK languages.
4. Body minimum entropy
Set body_min_entropy
to about half of the min_post_length
value.
Reduplication is common in CJK languages, and these characters are meaningful. Setting this value too high may result in users encountering “not meaningful post” errors.
5. Minimum topic title length and entropy
Adjust min_topic_title_length
and title_min_entropy
similarly to the post length and body entropy settings.
6. Minimum title and body similarity length
Set min_title_similar_length
and min_body_similar_length
according to the values you’ve assigned in the previous steps.
Troubleshooting search issues
If you encounter problems with search functionality after making these changes, you may need to reindex your database. Here’s how to do it:
- Enter your Discourse Docker installation directory.
- Run the following command to access the app container:
./launcher enter app
- Once inside the container, run the reindexing command:
rake search:reindex
After reindexing, you should be able to search content effectively.
Last edited by @hugh 2024-07-26T01:02:02Z
Last checked by @hugh 2024-07-26T01:02:07Z
Check document
Perform check on document: