An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: Search type filtering supports Audio, Video, IFrame and Widget block https://github.com/siyuan-note/siyuan/issues/10645
Daniel4f1013a35e7e
diff --git a/kernel/conf/search.go b/kernel/conf/search.goindex 31b36d163e..1eb93f3966 100644--- a/kernel/conf/search.go+++ b/kernel/conf/search.go@@ -38,6 +38,10 @@ type Search struct {HTMLBlock bool `json:"htmlBlock"`EmbedBlock bool `json:"embedBlock"`DatabaseBlock bool `json:"databaseBlock"`+ AudioBlock bool `json:"audioBlock"`+ VideoBlock bool `json:"videoBlock"`+ IFrameBlock bool `json:"iframeBlock"`+ WidgetBlock bool `json:"widgetBlock"`Limit int `json:"limit"`CaseSensitive bool `json:"caseSensitive"`@@ -76,6 +80,10 @@ func NewSearch() *Search {HTMLBlock: true,EmbedBlock: false,DatabaseBlock: true,+ AudioBlock: true,+ VideoBlock: true,+ IFrameBlock: true,+ WidgetBlock: true,Limit: 64,CaseSensitive: false,@@ -195,11 +203,30 @@ func (s *Search) TypeFilter() string {buf.WriteByte('\'')buf.WriteString(",")}-- // 无法搜索到 iframe 块、视频块和音频块 https://github.com/siyuan-note/siyuan/issues/3604- buf.WriteString("'iframe','video','audio',")- // 挂件块支持内置属性搜索 https://github.com/siyuan-note/siyuan/issues/4497- buf.WriteString("'widget',")+ if s.AudioBlock {+ buf.WriteByte('\'')+ buf.WriteString(treenode.TypeAbbr(ast.NodeAudio.String()))+ buf.WriteByte('\'')+ buf.WriteString(",")+ }+ if s.VideoBlock {+ buf.WriteByte('\'')+ buf.WriteString(treenode.TypeAbbr(ast.NodeVideo.String()))+ buf.WriteByte('\'')+ buf.WriteString(",")+ }+ if s.IFrameBlock {+ buf.WriteByte('\'')+ buf.WriteString(treenode.TypeAbbr(ast.NodeIFrame.String()))+ buf.WriteByte('\'')+ buf.WriteString(",")+ }+ if s.WidgetBlock {+ buf.WriteByte('\'')+ buf.WriteString(treenode.TypeAbbr(ast.NodeWidget.String()))+ buf.WriteByte('\'')+ buf.WriteString(",")+ }ret := buf.String()if "" == ret {diff --git a/kernel/model/search.go b/kernel/model/search.goindex 925ca5b145..0fcd5f4845 100644--- a/kernel/model/search.go+++ b/kernel/model/search.go@@ -971,6 +971,10 @@ func buildTypeFilter(types map[string]bool) string {s.HTMLBlock = types["htmlBlock"]s.EmbedBlock = types["embedBlock"]s.DatabaseBlock = types["databaseBlock"]+ s.AudioBlock = types["audioBlock"]+ s.VideoBlock = types["videoBlock"]+ s.IFrameBlock = types["iFrameBlock"]+ s.WidgetBlock = types["widgetBlock"]} else {s.Document = Conf.Search.Documents.Heading = Conf.Search.Heading@@ -985,6 +989,10 @@ func buildTypeFilter(types map[string]bool) string {s.HTMLBlock = Conf.Search.HTMLBlocks.EmbedBlock = Conf.Search.EmbedBlocks.DatabaseBlock = Conf.Search.DatabaseBlock+ s.AudioBlock = Conf.Search.AudioBlock+ s.VideoBlock = Conf.Search.VideoBlock+ s.IFrameBlock = Conf.Search.IFrameBlock+ s.WidgetBlock = Conf.Search.WidgetBlock}return s.TypeFilter()}