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: https://github.com/siyuan-note/siyuan/issues/16030
Danielc4b52b6aeefa
diff --git a/kernel/av/filter.go b/kernel/av/filter.goindex 31f2834ef1..9231b2f2ef 100644--- a/kernel/av/filter.go+++ b/kernel/av/filter.go@@ -157,10 +157,6 @@ func (value *Value) Filter(filter *ViewFilter, attrView *AttributeView, itemID s// 单独处理汇总if nil != value.Rollup && KeyTypeRollup == value.Type && nil != filter.Value && KeyTypeRollup == filter.Value.Type && nil != filter.Value.Rollup {- if 1 > len(filter.Value.Rollup.Contents) {- return true- }-key, _ := attrView.GetKey(value.KeyID)if nil == key {return false@@ -200,10 +196,16 @@ func (value *Value) Filter(filter *ViewFilter, attrView *AttributeView, itemID sif FilterOperatorIsEmpty == filter.Operator {return true} else if FilterOperatorIsNotEmpty == filter.Operator {- return false+ if 0 < len(value.Rollup.Contents) {+ return true+ }}}+ if 1 > len(filter.Value.Rollup.Contents) {+ return true+ }+for _, content := range value.Rollup.Contents {if content.filter(filter.Value.Rollup.Contents[0], filter.RelativeDate, filter.RelativeDate2, filter.Operator) {return true@@ -220,6 +222,10 @@ func (value *Value) Filter(filter *ViewFilter, attrView *AttributeView, itemID s}}+ if 1 > len(filter.Value.Rollup.Contents) {+ return true+ }+for _, content := range value.Rollup.Contents {if !content.filter(filter.Value.Rollup.Contents[0], filter.RelativeDate, filter.RelativeDate2, filter.Operator) {return false@@ -235,6 +241,10 @@ func (value *Value) Filter(filter *ViewFilter, attrView *AttributeView, itemID s}}+ if 1 > len(filter.Value.Rollup.Contents) {+ return true+ }+for _, content := range value.Rollup.Contents {if content.filter(filter.Value.Rollup.Contents[0], filter.RelativeDate, filter.RelativeDate2, filter.Operator) {return false@@ -282,15 +292,16 @@ func (value *Value) Filter(filter *ViewFilter, attrView *AttributeView, itemID s// 单独处理资源if nil != value.MAsset && KeyTypeMAsset == value.Type && nil != filter.Value && KeyTypeMAsset == filter.Value.Type {- if 1 > len(filter.Value.MAsset) {- return true- }-key, _ := attrView.GetKey(value.KeyID)if nil == key {return false}+ var filterContent string+ if 1 <= len(filter.Value.MAsset) {+ filterContent = filter.Value.MAsset[0].Content+ }+switch filter.Qualifier {case FilterQuantifierUndefined, FilterQuantifierAny:if 1 > len(value.MAsset) { // 说明资源字段为空@@ -304,12 +315,12 @@ func (value *Value) Filter(filter *ViewFilter, attrView *AttributeView, itemID sfor _, asset := range value.MAsset {switch asset.Type {case AssetTypeFile:- if filterTextContent(filter.Operator, asset.Name, filter.Value.MAsset[0].Content) ||- filterTextContent(filter.Operator, asset.Content, filter.Value.MAsset[0].Content) {+ if filterTextContent(filter.Operator, asset.Name, filterContent) ||+ filterTextContent(filter.Operator, asset.Content, filterContent) {return true}case AssetTypeImage:- if filterTextContent(filter.Operator, asset.Content, filter.Value.MAsset[0].Content) {+ if filterTextContent(filter.Operator, asset.Content, filterContent) {return true}}@@ -326,12 +337,12 @@ func (value *Value) Filter(filter *ViewFilter, attrView *AttributeView, itemID sfor _, asset := range value.MAsset {switch asset.Type {case AssetTypeFile:- if !filterTextContent(filter.Operator, asset.Name, filter.Value.MAsset[0].Content) &&- !filterTextContent(filter.Operator, asset.Content, filter.Value.MAsset[0].Content) {+ if !filterTextContent(filter.Operator, asset.Name, filterContent) &&+ !filterTextContent(filter.Operator, asset.Content, filterContent) {return false}case AssetTypeImage:- if !filterTextContent(filter.Operator, asset.Content, filter.Value.MAsset[0].Content) {+ if !filterTextContent(filter.Operator, asset.Content, filterContent) {return false}}@@ -350,17 +361,17 @@ func (value *Value) Filter(filter *ViewFilter, attrView *AttributeView, itemID sswitch asset.Type {case AssetTypeFile:if "" != strings.TrimSpace(asset.Name) {- if filterTextContent(filter.Operator, asset.Name, filter.Value.MAsset[0].Content) {+ if filterTextContent(filter.Operator, asset.Name, filterContent) {return false}}if "" != strings.TrimSpace(asset.Content) {- if filterTextContent(filter.Operator, asset.Content, filter.Value.MAsset[0].Content) {+ if filterTextContent(filter.Operator, asset.Content, filterContent) {return false}}case AssetTypeImage:- if filterTextContent(filter.Operator, asset.Content, filter.Value.MAsset[0].Content) {+ if filterTextContent(filter.Operator, asset.Content, filterContent) {return false}}