Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chinese search support #1496

Closed
wants to merge 2 commits into from
Closed

chinese search support #1496

wants to merge 2 commits into from

Conversation

aowji
Copy link

@aowji aowji commented Apr 3, 2021

chinese search support.

set language to zh, then you can search chinese word.

[book]
authors = ["Zhou Yue"]
language = "zh"
multilingual = false
src = "src"
title = "trial"

捕获

@ZhangHanDong
Copy link

ZhangHanDong commented Jan 15, 2022

@ehuss

Why is this pr not merged and there is no reply? There are many people in the Chinese community who use mdbook and can only search in English at the moment, so why hasn't this pr been merged in 10 months? Is there any reason?

@ehuss
Copy link
Contributor

ehuss commented Jan 15, 2022

Sorry, I don't have time to review all PRs.

Just a quick scan of this PR, there are a number of issues:

  • The inclusion of the extra stuff needs to be conditional. For books not using chinese, it is a significant extra cost. This includes building elasticlunr, which IIRC is a large increase, and the inclusion of extra javascript.
  • This PR includes formatting changes unrelated to the PR (such as indentation changes). Those should usually be separate.
  • It's not clear why the extra javascript is needed. Without some sort of explanation in the PR description, it requires reverse-engineering the code, which takes a lot of time.

@ZhangHanDong
Copy link

@ehuss Thanks for the reply, know the reason can be better to improve it.

@Sciroccogti
Copy link

I tried it, and it seems that extra javascript should be included as additional-js. If so, then maybe we should treat the extra javascript files in another way?

[output.html]
additional-js = [
    "lunr.zh.js",
    "lunr.stemmer.support.js",
]

@Akagi201
Copy link

Please add language = 'zh-CN', 'zh-HK', 'zh-TW' these aliases

@xuscode
Copy link

xuscode commented Jun 5, 2022

chinese search support.

set language to zh, then you can search chinese word.

[book]
authors = ["Zhou Yue"]
language = "zh"
multilingual = false
src = "src"
title = "trial"

捕获

hi,为什么我的不能搜索中文?我也设置了 "zh"

@futurist
Copy link

Any progress to this PR? Really need Non-English Support.

@tasuren
Copy link

tasuren commented Dec 24, 2022

Any progress to this PR? Really need Non-English Support.

I think so too.

@TinySnow
Copy link

TinySnow commented Jan 9, 2023

Is there any progress on this pr?

@wc7086
Copy link

wc7086 commented May 14, 2023

  • It's not clear why the extra javascript is needed. Without some sort of explanation in the PR description, it requires reverse-engineering the code, which takes a lot of time.

javascript From https://github.com/MihaiValentin/lunr-languages, a better option would be to just use "lunr-languages" and no longer use "elasticlunr". Until then, it may be necessary to wait for some progress to be made on #5 .

A better option might be https://github.com/ajitid/fzf-for-js, a local search engine that supports Unicode, see ajitid/fzf-for-js#112 for Unicode support.

@schungx
Copy link

schungx commented May 14, 2023

Chinese is usually troublesome because there are no word breaks, meaning that the indexing must be done via either a heuristic to break up words or a natural language processor that understands the text and can break words.

Otherwise you'd need to index all individual characters as well as all pairwise combinations at least

@silence-coding
Copy link

Looking forward to new progress on this MR

@silence-coding
Copy link

Are there any new developments on this issue?

@miaomiao1992
Copy link

is there any progress about this issue?

@Sunshine40
Copy link

@ehuss I'd like to work on this feature request.

Would creating my own fork and making a new PR be the correct way to do this?

@aowji aowji closed this by deleting the head repository Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.