squidfunk / mkdocs-material

Documentation that simply works

Home Page:https://squidfunk.github.io/mkdocs-material/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does mkdocs support Chinese search?

yuxiang660 opened this issue · comments

commented

Contribution guidelines

I want to suggest an idea and checked that ...

  • ... to my best knowledge, my idea wouldn't break something for other users
  • ... the documentation does not mention anything about my idea
  • ... there are no open or closed issues that are related to my idea

Description

I find that lunr-languages supports Chinese. But when I try to configure "search" plugin in mkdocs, it fails with following error.

INFO     -  Building documentation...
INFO     -  Option search.lang 'zh' is not supported, falling back to 'en'
INFO     -  [00:44:06] Reloading browsers

Is there any plan to support Chinese search in mkdocs?

Use Cases

mkdocs.yml

plugins:

  • search:
    lang: zh

Screenshots / Mockups

No response

Thanks for reporting. We can't use the Chinese language support because it uses native extensions. I've explained the problem in mkdocs/mkdocs#2509 (comment). Until this is fixed in lunr-languages, Chinese search works somewhat with the Japanese language support, but it's not perfect.

Experimental support for Chinese segmentation has been added in #3882 (comment).

Chinese language support has been released as part of 8.2.13+insiders-4.14.0. The blog article sums up my previous comment and explains how to set it up. I'm not proficient in Chinese, so I'm very interested in feedback!