⚡ 改进块引搜索性能 Fix https://github.com/siyuan-note/siyuan/issues/6655
This commit is contained in:
parent
f64c3439f4
commit
99e09951ac
2 changed files with 10 additions and 1 deletions
|
@ -489,6 +489,7 @@ func scanBlockRows(rows *sql.Rows) (ret *Block) {
|
|||
return
|
||||
}
|
||||
ret = &block
|
||||
putBlockCache(ret)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ import (
|
|||
"github.com/88250/lute/parse"
|
||||
"github.com/emirpasic/gods/sets/hashset"
|
||||
"github.com/siyuan-note/logging"
|
||||
"github.com/siyuan-note/siyuan/kernel/search"
|
||||
)
|
||||
|
||||
func QueryVirtualRefKeywords(name, alias, anchor, doc bool) (ret []string) {
|
||||
|
@ -149,7 +150,14 @@ func QueryRefRootBlocksByDefRootID(defRootID string) (ret []*Block) {
|
|||
return
|
||||
}
|
||||
|
||||
func GetRefText(defBlockID string) string {
|
||||
func GetRefText(defBlockID string) (ret string) {
|
||||
ret = getRefText(defBlockID)
|
||||
ret = strings.ReplaceAll(ret, search.SearchMarkLeft, "")
|
||||
ret = strings.ReplaceAll(ret, search.SearchMarkRight, "")
|
||||
return
|
||||
}
|
||||
|
||||
func getRefText(defBlockID string) string {
|
||||
block := GetBlock(defBlockID)
|
||||
if nil == block {
|
||||
if strings.HasPrefix(defBlockID, "assets") {
|
||||
|
|
Loading…
Add table
Reference in a new issue