Skip to content

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

:sparkles: Support for searching asset content https://github.com/siyuan-note/siyuan/issues/8874

Daniel253b228bb092
diff --git a/kernel/model/asset_content.go b/kernel/model/asset_content.go
index 047110f103..1863962e24 100644
--- a/kernel/model/asset_content.go
+++ b/kernel/model/asset_content.go
@@ -153,7 +153,7 @@ func fullTextSearchAssetContentCountByRegexp(exp, typeFilter string) (matchedAss
func fullTextSearchAssetContentByFTS(query, typeFilter, orderBy string, beforeLen, page, pageSize int) (ret []*AssetContent, matchedAssetCount int) {
table := "asset_contents_fts_case_insensitive"
projections := "id, name, ext, path, size, updated, " +
- "highlight(" + table + ", 6, '<mark>', '</mark>') AS content"
+ "snippet(" + table + ", 6, '<mark>', '</mark>', '...', 64) AS content"
stmt := "SELECT " + projections + " FROM " + table + " WHERE (`" + table + "` MATCH '" + buildAssetContentColumnFilter() + ":(" + query + ")'"
stmt += ") AND ext IN " + typeFilter
stmt += " " + orderBy