0xffff-one / flarum-0x

🔧 Customized Flarum for the 0xFFFF Community.
https://0xffff.one
MIT License
44 stars 5 forks source link

【扩展】中文搜索插件针对 v1.0 定制 #20

Closed zgq354 closed 3 years ago

zgq354 commented 3 years ago

中文站内搜索目前有两种方案:

  1. MySQL 全文索引方式实现(参见:https://discuss.flarum.org.cn/d/1216),这种模式,且对数据库有额外开销
  2. xunsearch 的方案(目前线上的方案,但插件暂不支持 beta.16 版本,需重新适配,参见:https://discuss.flarum.org.cn/d/1112

所以可以先想办法把 xunsearch 插件移植到 beta.16 上

Originally posted by @zgq354 in https://github.com/0xffff-one/0xffff-flarum/issues/15#issuecomment-841786522

zgq354 commented 3 years ago

相关 issue https://github.com/jjandxa/flarum-ext-chinese-search/issues/26

stimw commented 3 years ago

typesense引擎: mkm0094/flarum-typesense-chinese-search

stimw commented 3 years ago

Another: ganuonglachanh/flarum-sonic

zgq354 commented 3 years ago

Another: ganuonglachanh/flarum-sonic

https://dev.0xffff.one 测试了一下,搜索功能正常,但搜索帖内关键字时候选状态没有正文的预览(待定位具体原因 image

预期情况: image

zgq354 commented 3 years ago

Another: ganuonglachanh/flarum-sonic

https://dev.0xffff.one 测试了一下,搜索功能正常,但搜索帖内关键字时候选状态没有正文的预览(待定位具体原因 image

预期情况: image

主要是 TitleGamblit 部分的差异: https://github.com/ganuonglachanh/flarum-sonic/blob/8421240274d4c20eab9afdbb7bd19c9ee3a001d8/src/Gambit/TitleGambit.php#L26

插件替换了 Core 的 FulltextGambit 的实现,但未实现 mostRelevantPost 的功能: https://github.com/flarum/core/blob/1f2411e15e46fbfb7a499a69a869663c349cca91/src/Discussion/Search/Gambit/FulltextGambit.php#L51

然后返回的数据缺少这个导致: image

zgq354 commented 3 years ago

Another: ganuonglachanh/flarum-sonic

已启用 sonic https://github.com/0xffff-one/0xffff-env/commit/fea29ec144dc8f137534814c9e1fa29491252dcc