Skip to content

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

:art: Marketplace search for multiple keywords uses AND logic https://github.com/siyuan-note/siyuan/issues/14293

Daniel51e9dc839bcb
diff --git a/kernel/model/bazzar.go b/kernel/model/bazzar.go
index 65ee8db9ac..c7229a0552 100644
--- a/kernel/model/bazzar.go
+++ b/kernel/model/bazzar.go
@@ -501,6 +501,7 @@ func matchPackage(keywords []string, pkg *bazaar.Package) bool {
return false
}
+ hitCount := 0
for _, keyword := range keywords {
if strings.Contains(strings.ToLower(pkg.DisplayName.Default), keyword) ||
strings.Contains(strings.ToLower(pkg.DisplayName.ZhCN), keyword) ||
@@ -512,16 +513,16 @@ func matchPackage(keywords []string, pkg *bazaar.Package) bool {
strings.Contains(strings.ToLower(pkg.Description.EnUS), keyword) ||
strings.Contains(strings.ToLower(path.Base(pkg.RepoURL)), keyword) ||
strings.Contains(strings.ToLower(pkg.Author), keyword) {
- return true
+ hitCount++
}
for _, pkgKeyword := range pkg.Keywords {
if strings.Contains(strings.ToLower(pkgKeyword), keyword) {
- return true
+ hitCount++
}
}
}
- return false
+ return hitCount == len(keywords)
}
func getSearchKeywords(query string) (ret []string) {