🎨 Block ref search and global search results display reference counts https://github.com/siyuan-note/siyuan/issues/15721

This commit is contained in:
Daniel 2025-08-31 13:07:50 +08:00
parent b8bcf76f75
commit 1cac4ae55b
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -1323,12 +1323,24 @@ func FullTextSearchBlock(query string, boxes, paths []string, types map[string]b
var nodeIDs []string
for _, b := range ret {
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 {
if 0 == groupBy {
b.RefCount = refCount[b.ID]
} else {
for _, c := range b.Children {
c.RefCount = refCount[c.ID]
}
}
}
return
}