An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:zap: 改进块引搜索性能 Fix https://github.com/siyuan-note/siyuan/issues/6655
Liang Ding99e09951ac00
diff --git a/kernel/sql/block_query.go b/kernel/sql/block_query.goindex a98b23794a..8581bfe32a 100644--- a/kernel/sql/block_query.go+++ b/kernel/sql/block_query.go@@ -489,6 +489,7 @@ func scanBlockRows(rows *sql.Rows) (ret *Block) {return}ret = &block+ putBlockCache(ret)return}diff --git a/kernel/sql/block_ref_query.go b/kernel/sql/block_ref_query.goindex 0b6388c5bd..f097b20abc 100644--- a/kernel/sql/block_ref_query.go+++ b/kernel/sql/block_ref_query.go@@ -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") {