88250 / solo

🎸 B3log 分布式社区的 Java 博客端节点系统,欢迎加入下一代社区网络。B3log distributed community blog-end node based on Java, welcome to join the next generation community network.
https://b3log.org/solo
Other
1.56k stars 440 forks source link

管理端搜索文章的时候,搜索结果中包含了其他没有该关键词的文章 #239

Closed wenming5112 closed 2 years ago

wenming5112 commented 2 years ago

描述问题 Describe the problem

搜索结果与预期不符。比如搜索redis,搜索出了其他不含这个词的文章。

期待的结果 Expected result

搜索出所有含redis的文章。

截屏或录像 Screenshot or video

image

版本环境 Version environment

应该所有版本都存在这个问题,我看issue中不存在该问题。

其他信息 Other information

wenming5112 commented 2 years ago

首页的搜索通用存在上面的问题

image

image

88250 commented 2 years ago

应该是文章正文中包含了。

wenming5112 commented 2 years ago

我的,文章中确实是有与文章主题无关的关键词,导致搜索匹配不准确。我觉得这里可以优化,优先匹配分类和标签,如果没有命中则根据全文检索的结果来获取记录。简单来说呢就是分类和标签获取的记录和全文检索的记录取交集。

88250 commented 2 years ago

欢迎 PR 贡献改进代码。