Skip to content

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

:art: `搜索结果显示数` 最小限制为 32 https://github.com/siyuan-note/siyuan/issues/7384

Liang Ding5ca70f519551
diff --git a/kernel/api/setting.go b/kernel/api/setting.go
index 13e870b2e1..a69c075287 100644
--- a/kernel/api/setting.go
+++ b/kernel/api/setting.go
@@ -209,8 +209,8 @@ func setSearch(c *gin.Context) {
return
}
- if 1 > s.Limit {
- s.Limit = 64
+ if 32 > s.Limit {
+ s.Limit = 32
}
oldCaseSensitive := model.Conf.Search.CaseSensitive
diff --git a/kernel/model/conf.go b/kernel/model/conf.go
index 722d61040c..ee3e50f902 100644
--- a/kernel/model/conf.go
+++ b/kernel/model/conf.go
@@ -293,6 +293,9 @@ func InitConf() {
if 1 > Conf.Search.Limit {
Conf.Search.Limit = 64
}
+ if 32 > Conf.Search.Limit {
+ Conf.Search.Limit = 32
+ }
if 1 > Conf.Search.BacklinkMentionKeywordsLimit {
Conf.Search.BacklinkMentionKeywordsLimit = 512
}