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

Can't search in Chinese. #41

Closed
shuhankuang opened this issue Sep 3, 2014 · 13 comments
Closed

Can't search in Chinese. #41

shuhankuang opened this issue Sep 3, 2014 · 13 comments
Labels
bug Issue with Existing Functionality

Comments

@shuhankuang
Copy link

I find that it can't work with Chinese. :(

@nykma
Copy link

nykma commented Nov 27, 2014

Same here. Seems like lunr doesn't support utf-8.

@bborysenko
Copy link

Same for Russian :(

@bborysenko
Copy link

It seems i have found the way how to add support for languages other than English.

For that i have installed the lunr-languages package:

[~/Raneto-0.6.0]$ npm install lunr-languages

And add a few lines to node_modules/raneto-core/raneto.js:

[~/Raneto-0.6.0]$ diff node_modules/raneto-core/raneto.js node_modules/raneto-core/raneto.js.orig
10,11d9
<   require('../lunr-languages/lunr.stemmer.support.js')(lunr);
<   require('../lunr-languages/lunr.ru.js')(lunr);
199d196
<           this.use(lunr.ru);

@nykma
Copy link

nykma commented Nov 27, 2014

Nice job man!
But still, no Chinese support in lunr-languages :(

@bborysenko
Copy link

Yes really, I have missed that point. Then perhaps you might try to replace default lunr package with that one - https://github.com/codepiano/lunr.js?

@in-in
Copy link

in-in commented Dec 27, 2014

@bborysenko, дай бог тебе здоровья =)

@ryanlelek ryanlelek added the bug Issue with Existing Functionality label Oct 1, 2015
@ryanlelek
Copy link
Owner

Chinese search support was mentioned in another issue that was closed, so I'll summarize it here.

@vyp said:

For Chinese searching, you will probably have to modify raneto to add support for lunr-languages: olivernn/lunr.js#91 (comment). But as you can see in that link, lunr-languages does not yet support Chinese.

Another potential option would be to try and replace the lunr that Raneto uses with https://github.com/codepiano/lunr.js, which seems like a Chinese version of lunr.js (found with the comment just below the previously linked comment). I haven't used this though, so I'm not sure if this only support Chinese, or supports both English and Chinese.

@codepiano replied:

My fork of lunr supports both English and Chinese.I use it to replace the original lunr repo in gitbook dependencies, and it works well.
...
I'll test whether it works well in Raneto when I have time. Raneto is a nice tool.

Looping you all in via mention so we can restart this and get a solution.
@LuxuryZhou, @shuhankuang, @nykma, @OneManOpsTeam, @in-in

@ryanlelek ryanlelek added the pending Pending Close. Respond label Oct 12, 2015
@codepiano
Copy link

Gitbook use lunr.js to build search index from original markdown files, store the index in a file,and load this file in web page.
If Raneto also uses lunr.js this way,maybe my fork version will also work.

@codepiano
Copy link

@ryanlelek
Sorry for late, if you want add search support for Chinese, use 'codepiano/lunr.js' replace official lunr.js dependency in module 'rateno-core', not 'rateno' itself, like this:

    "lunr": "codepiano/lunr.js",

It seems fine.

@ZhangTongLe
Copy link

@codepiano 我按照您的方案配置了lunr.js 和Raneto,nodejieba 也安装好了,但是搜索中文的时候,还是不能搜索中文,不造啥原因~,大神能帮忙集成一下,十分感谢~!

@ZhangTongLe
Copy link

@codepiano @ryanlelek Thank OF provide such a good tool, replaced by the support of the Chinese lunr.js codepiano has successfully support Chinese search

@ryanlelek
Copy link
Owner

Fixed in #246 by @Orhideous

@chinayangh
Copy link

@ZhangTongLe can you post step by step details about how to config Raneto to support Chinese keywords search ? Any help from you will be greatly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue with Existing Functionality
Projects
None yet
Development

No branches or pull requests

8 participants