From 1cac4ae55b24580ab7a69509ae0e6743ea37295b Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Sun, 31 Aug 2025 13:07:50 +0800 Subject: [PATCH] :art: Block ref search and global search results display reference counts https://github.com/siyuan-note/siyuan/issues/15721 --- kernel/model/search.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/kernel/model/search.go b/kernel/model/search.go index 4a5845061..d32814241 100644 --- a/kernel/model/search.go +++ b/kernel/model/search.go @@ -1323,12 +1323,24 @@ func FullTextSearchBlock(query string, boxes, paths []string, types map[string]b var nodeIDs []string for _, b := range ret { - nodeIDs = append(nodeIDs, b.ID) + if 0 == groupBy { + nodeIDs = append(nodeIDs, b.ID) + } else { + for _, c := range b.Children { + nodeIDs = append(nodeIDs, c.ID) + } + } } refCount := sql.QueryRefCount(nodeIDs) for _, b := range ret { - b.RefCount = refCount[b.ID] + if 0 == groupBy { + b.RefCount = refCount[b.ID] + } else { + for _, c := range b.Children { + c.RefCount = refCount[c.ID] + } + } } return }