Fix: 修复了搜索功能无法使用的问题(issue #15) #31
Merged
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.
问题详情
#15
原因
原本的代码直接使用的默认搜索,但本项目是静态导出的项目,需要进行静态导出的搜索配置。
解决方案
给搜索框添加了静态搜索的配置,并添加了生成用于静态搜索支持的search.json的路由。
完成第一次commit后,搜索功能可用,但无法中文搜索
第二次commit添加了orama中文分词器,以支持中文搜索,但是效果很差……少见的词汇就搜不到,比如“部署”可搜,但“美团” 搜不到……
后来查找发现fumadocs支持的其他搜索均需要付费,只有orama是可直接用的,所以目前只能凑合用了。
后续加rag啥的有后端了,考虑用自己部署的更专业可用的搜索,或替换一些别的更好的搜索服务。