Skip to content
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

Improve search default sort #8624

Closed
3 tasks done
gdy106 opened this issue Jun 26, 2023 · 1 comment
Closed
3 tasks done

Improve search default sort #8624

gdy106 opened this issue Jun 26, 2023 · 1 comment
Assignees
Milestone

Comments

@gdy106
Copy link

gdy106 commented Jun 26, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Can the issue be reproduced with the default theme (daylight/midnight)?

  • I was able to reproduce the issue with the default theme

Could the issue be due to extensions?

  • I've ruled out the possibility that the extension is causing the problem.

Describe the problem

之前在https://ld246.com/article/1687574578775这个帖子借楼反馈过这个问题,但我后来再测试的时候没有复现,现在发现问题所在:我第一次录屏的时候测试的文件是加粗的关键词放在开头了,如图:
image
我今天调整了测试文档的内容,在加粗的关键词前面加上了没有行级样式的正文,复现了搜索和引用中带有行级样式文字的检索结果被置底的bug。
image

image
image

Expected result

检索结果按照正常顺序显示

Screenshot or screen recording presentation

2023-06-26-22-59-56.mp4

Version environment

- Version: 2.9.2
- Operating System:win10 
- Browser (if used):

Log file

siyuan.log

More information

No response

@88250
Copy link
Member

88250 commented Jun 26, 2023

感谢反馈,这和加粗等行级元素没有关系的,搜索时不指定排序规则的话是按 sort 字段排序,也就是块类型,如果块类型都一样,比如都是段落块的话会按照 SQLite FTS5 内建的排序算法,这个排序算法我没有仔细研究,观察了下大概是最新更新的数据会被放在最后。

下个版本我们稍微调整一下,在不指定排序的情况下默认使用 sort 升序和 updated 降序,这样就能在同类型时稳定得到按更新时间降序的结果了。

@88250 88250 self-assigned this Jun 26, 2023
@88250 88250 changed the title 搜索和引用时检索的关键词带有行级样式会被置底 Improve search default sort Jun 26, 2023
@88250 88250 added this to the 2.9.3 milestone Jun 26, 2023
88250 added a commit that referenced this issue Jun 26, 2023
88250 added a commit that referenced this issue Jun 26, 2023
@88250 88250 closed this as completed Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants