-
Notifications
You must be signed in to change notification settings - Fork 118
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
[Bug]: search will stop when keyword in title(h1, h2, h3...), even the keyword also exists in content #1372
Comments
这可能跟 flexsearch 对于某些中文词汇和符号结合的分词在某些情况下存在缺陷有关,可以尝试使用 `` 代码块语法而不是【】,也可以检查构建后产生的索引 json 文件。 中文相关的搜索问题一般很难修复。 |
但是如果把标题“批量操作手续费”删掉或者改成不包含“手续费”的标题,再次搜索“手续费”就有多个搜索结果了。 |
是这样的 |
我看了下代码,设计如此,同一区块内匹配到了标题后,没有必要再显示正文内容,这会导致内容的臃肿 rspress/packages/theme-default/src/components/Search/logic/search.ts Lines 92 to 96 in d9021eb
|
但是在其他同级区块下的内容也搜索不到了。 |
个人感觉这里有两个问题: |
Thanks for your detailed analysis, I carefully reviewed some related code just now, I think this should be fixed/enhanced. Are you interested in contributing a PR? |
版本信息
System: OS: Linux 5.15 Ubuntu 20.04.3 LTS (Focal Fossa) CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz Memory: 10.97 GB / 15.62 GB Container: Yes Shell: 5.0.17 - /bin/bash npmPackages: rspress: ^1.28.0 => 1.28.2
问题详情
md 文档内容类似于:
当搜索
手续费
时,只能搜索到标题 > 批量操作手续费
:而搜索 “保存” 时,可以搜索到多个结果:
复现链接
https://codesandbox.io/p/devbox/naughty-darwin-pqq75j?workspaceId=edafb2d3-8406-4734-ac75-3017fd4fe3d8
复现步骤
想要的结果是能够搜索标题中的
批量操作手续费
以及内容中的手续费
。The text was updated successfully, but these errors were encountered: