Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Improve search highlighting https://github.com/siyuan-note/siyuan/issues/13686

Danielda35416ed5e8
diff --git a/kernel/model/file.go b/kernel/model/file.go
index 909010e412..0f3c2a938c 100644
--- a/kernel/model/file.go
+++ b/kernel/model/file.go
@@ -640,7 +640,8 @@ func GetDoc(startID, endID, id string, index int, query string, queryTypes map[s
typeFilter := buildTypeFilter(queryTypes)
switch queryMethod {
case 0:
- keywords = strings.Split(query, " ")
+ query = stringQuery(query)
+ keywords = highlightByFTS(query, typeFilter, rootID)
case 1:
keywords = highlightByFTS(query, typeFilter, rootID)
case 3: