Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
lc-pinyin分析器很强大,我们在搜索框自动提示中用着很爽。感谢作者分享!
不过,在处理中英文混合文档或者纯英文、数字时,我们遇到一个小问题,希望得到改进:
使用lc_index分析器索引文档“CBD”,然后使用lc_search分析器构建match_phrase查询,搜索“CBD” ,无法匹配。
经过反复测试,发现对于英文单词和数字,lc_index 分析器默认不会切分成单字符,比如“CBD”经分析后还是"CBD",而lc_search默认会切分成单字符搜索,比如“CBD”经分析后变成了“C” "B" "D",这样就搜不到结果了。 因此我们尝试修改lc_index生成token的过程,让输入“CBD”输出“CBD” “C” “B” “D”,这样可以解决搜不到的问题。 希望能够合并代码,并加以优化:把单词拆成单个字符的功能做成一个开关,供有需要的人使用。谢谢!