Search chinese words problems


(Leon Tian) #1

I search chiese words 安全 in search tools, because the word is in the middle of the centence , so I can search nothing. Is it a bug ?

This is my site :https://bbs.leangoo.com/ and topics : leangoo协作工具,对数据安全有保障吗? - 问答 - Leangoo社区


(Stephen Chung) #2

I believe there was a discussion regarding how PostgreSQL (the database used by Discourse) cannot build full-text search index for CJK languages.


(Stephen Chung) #3

See also:


(Stephen Chung) #4

There are a few things required for turning on CJK support:

  1. Turn on the CJK tokenizer

    a. Default locale = zh_TW or zh_CN, OR

    b. Setting search_tokenize_chinese_japanese_korean set to true (default false) to force tokenization of CJK if default locale is not Chinese.

  2. Setting min_search_term_length set to 1 (because the CJK tokenizer doesn’t recognize a lot of word combos and turns them all to single characters)

  3. Rebuild the full-text index – the index won’t be changed when you set the above, and any old posts will not be indexed properly: rake search:reindex

  1. Bob’s your uncle!

(Leon Tian) #5

This is my setting
image

I will try like you said, thank you !