mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
🎨 Block ref search and global search results display reference counts https://github.com/siyuan-note/siyuan/issues/15721
This commit is contained in:
parent
b8bcf76f75
commit
1cac4ae55b
1 changed files with 14 additions and 2 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue