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
改进搜索排序规则 #4546
Comments
问题1:现在列表项和文档块的搜索结果都不会高亮,以及现在的块引搜索显示速度貌似比之前慢了一些: 问题2:对于搜索结果中的列表项,之前是在搜索界面显示全content的内容,1.9.8中应该是因为 #4536 这个 issue 导致不止是锚文本,搜索结果界面中也只显示了第一个块的content,这里应该还是和之前一样显示全content,不然可能会导致搜索结果中不同的列表项无法直接区分,不方便选择。 问题3:搜索结果的排序规则还是有问题 改进后的规则是在匹配度相同的情况下,再根据块类型排序吗? 现在的规则之下,有一些问题:
我的搜索排序规则想法如下,供参考:先按sort字段(我不太清楚sort的具体计算公式,是否可以公布一下呢?但按我之前的体验,应该至少满足了文档块优先级>标题块),然后按匹配度(对于列表块,希望能优化一下,不是直接匹配列表项本身的content,而是匹配列表项的第一个块的content),然后是命中次数(我记得之前是有这个指标的,没有的话忽略也行),然后是按length从小到大,之后其他指标 同时,在进行搜索召回时,对列表项判断是否要召回时,不按照列表项本身的content判断,而是按照列表项的第一个块的content进行判断,这样能保证搜索结果是最小可用的,使得搜索结果更加简洁清晰。因为列表项的content会套娃,会带来很多无意义的召回结果,例如下图,红框中的这些召回结果都是没意义的: 我再给几个案例,我认为排序规则应当能满足这几个案例的要求: 案例1:先新建一个文档叫做《多任务学习》,然后在这个文档内写上:
这时,我块引搜索 案例2: 在任意文档内写上:
这时候块引搜索 其实 https://ld246.com/article/1649338100756 这个帖子中的需求和排序有很大的关系,如果他想要的结果就在第一个或者第二个,那么他的需求就满足了,并不需要对块引搜索的交互做其他的改进,而现在的搜索排序有问题,导致他在帖子里说“块引搜索框目前不显示列表块和列表项块”、“搜索结果里只显示段落块”。 |
问题 1 先略过。 问题 2 单独建个 issue #4555 我们重点讨论问题 3。现在的实现大致是这样的 SQL: select *
from blocks
where ((content like '%foo%' or name like '%foo%' or alias like '%foo%' or memo like '%foo%'))
and type IN ('d', 'h', 'c', 'm', 't', 's', 'p', 'html', 'iframe', 'query_embed', 'video', 'audio', 'widget')
order by case
when name = 'foo' then 10
when alias = 'foo' then 20
when memo = 'foo' then 30
when content = 'foo' and type = 'd' then 31
when content = 'foo' and type = 'h' then 32
when content = 'foo' and type = 'i' then 33
when content = 'foo' then 40
when name LIKE '%foo%' then 50
when alias LIKE '%foo%' then 60
when memo LIKE '%foo%' then 70
when content LIKE '%foo%' and type = 'd' then 71
when content LIKE '%foo%' and type = 'h' then 72
when content LIKE '%foo%' and type = 'i' then 73
when content LIKE '%foo%' then 80
else 65535 end ASC, sort ASC, length ASC
limit 64
改进的话 blocks 表现有字应该不够,缺乏容器块第一个子块的 content 字段 老铁有空的话可以基于上面这个 SQL 帮忙改改看,谢谢。 |
在考虑匹配度的同时考虑 3 个类型:文档 > 标题 > 列表项
The text was updated successfully, but these errors were encountered: