Skip to content

块引搜索,段落块会在文档块之前 #10164

Closed
@Achuan-2

Description

@Achuan-2
Member

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

最近几个版本发现块引搜索,段落块会在文档块之前
Snipaste_2024-01-13_12-16-06
Snipaste_2024-01-13_12-19-10

想知道这个是bug,还是我设置问题?
还是特性?貌似在前面的几个块都有关键词多个命中

Expected result

块引搜索,文档块默认在其他块之前

Screenshot or screen recording presentation

No response

Version environment

- Version: v2.12.2
- Operating System: 
- Browser (if used):

Log file

none

More information

No response

Activity

Achuan-2

Achuan-2 commented on Jan 13, 2024

@Achuan-2
MemberAuthor

哦哦,我发现我没开启这个
Snipaste_2024-01-13_12-28-12

88250

88250 commented on Jan 13, 2024

@88250
Member

块引搜索有个排序算法,大致是这样的:

	orderBy := ` order by case
             when name = '${keyword}' then 10
             when alias = '${keyword}' then 20
             when memo = '${keyword}' then 30
             when content = '${keyword}' and type = 'd' then 40
             when content LIKE '%${keyword}%' and type = 'd' then 41
             when name LIKE '%${keyword}%' then 50
             when alias LIKE '%${keyword}%' then 60
             when content = '${keyword}' and type = 'h' then 70
             when content LIKE '%${keyword}%' and type = 'h' then 71
             when fcontent = '${keyword}' and type = 'i' then 80
             when fcontent LIKE '%${keyword}%' and type = 'i' then 81
             when memo LIKE '%${keyword}%' then 90
             when content LIKE '%${keyword}%' and type != 'i' and type != 'l' then 100
             else 65535 end ASC, sort ASC, length ASC`

我关闭了,感谢反馈。

Achuan-2

Achuan-2 commented on Jan 16, 2024

@Achuan-2
MemberAuthor

【【可以指定只搜索文档,选中文字之后Ctrl+【可以设置只搜索文档吗,目前我有好多次搜索都出现了代码块会在文档块之前的情况,此外感觉代码块的权重比文档块还高了?因为只是命中一次而已
Snipaste_2024-01-16_22-53-32
Snipaste_2024-01-16_22-54-15

Achuan-2

Achuan-2 commented on Jan 16, 2024

@Achuan-2
MemberAuthor

@88250
Ctrl+P搜索是正常的

Snipaste_2024-01-16_23-09-39

但是Alt+【就是段落块和代码块会在文档块之前
image
Snipaste_2024-01-16_23-10-29

88250

88250 commented on Jan 16, 2024

@88250
Member

麻烦制作一个能够重现问题的最小数据集,我调试看看。

Achuan-2

Achuan-2 commented on Jan 16, 2024

@Achuan-2
MemberAuthor

test.sy.zip
思源bug反馈
建立了三个文档,引用文档来测试Altl+【引用

88250

88250 commented on Jan 17, 2024

@88250
Member

定位到问题了,是在 #8886 中引入的 bug,下个版本修复,多谢。

added a commit that references this issue on Jan 17, 2024
Achuan-2

Achuan-2 commented on Jan 17, 2024

@Achuan-2
MemberAuthor

好滴,辛苦

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @88250@Achuan-2

        Issue actions

          块引搜索,段落块会在文档块之前 · Issue #10164 · siyuan-note/siyuan