From c917626d471f5769b5292cac425c4ea2cb035f37 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Wed, 3 Dec 2025 17:50:25 +0800 Subject: [PATCH] :art: Improve searching for move blocks https://github.com/siyuan-note/siyuan/issues/15564#issuecomment-3604599711 Signed-off-by: Daniel <845765@qq.com> --- kernel/model/file.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/model/file.go b/kernel/model/file.go index c53f3d5eb..30954e2f8 100644 --- a/kernel/model/file.go +++ b/kernel/model/file.go @@ -187,8 +187,8 @@ func SearchDocsByKeyword(keyword string, flashcard bool, excludeIDs []string) (r } } - if 0 < len(excludeIDs) { - condition += fmt.Sprintf(" AND root_id NOT IN ('%s')", strings.Join(excludeIDs, "', '")) + for _, excludeID := range excludeIDs { + condition += fmt.Sprintf(" AND path NOT LIKE '%%%s%%' ", excludeID) } rootBlocks = sql.QueryRootBlockByCondition(condition, Conf.Search.Limit)