-
Set the minimum search length to 1
Open admin dashboard, and set settings > others > “min search term length” to 1
-
Fix database encoding to UTF-8
-
Enter the discourse docker install directory and run:
./launcher enter app
-
Then enter postgreSQL console:
sudo -u postgres psql discourse
-
And update the encoding of database:
update pg_database set encoding = pg_char_to_encoding('UTF8') where datname = 'discourse';
-
Leave database:
\q
-
Reindex all content:
Only new content will have UTF-8 index, old content still use ASCII, so go to the docker discourse directory (usually at
/var/www/discourse
) and run:rake search:reindex
-
-
Now the content can search by CJK language.
Thanks to Audrey Tang, she give me support to finish this article.
Source: https://meta.discourse.org/t/adjust-discourse-search-to-work-with-cjk-languages/28741