mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-30 04:05:16 +01:00
🎨 在 设置 - 搜索 中分别增加虚拟引用和反链提及 关键字数量限制 https://github.com/siyuan-note/siyuan/issues/6603
This commit is contained in:
parent
87fde9a1e8
commit
deba07c4ad
11 changed files with 48 additions and 28 deletions
|
|
@ -737,7 +737,7 @@ func searchBackmention(mentionKeywords []string, keyword string, excludeBacklink
|
|||
buf := bytes.Buffer{}
|
||||
buf.WriteString("SELECT * FROM " + table + " WHERE " + table + " MATCH '{content}:(")
|
||||
for i, mentionKeyword := range mentionKeywords {
|
||||
if Conf.Search.BacklinkMentionLimit < i {
|
||||
if Conf.Search.BacklinkMentionKeywordsLimit < i {
|
||||
util.PushMsg(fmt.Sprintf(Conf.Language(38), len(mentionKeywords)), 5000)
|
||||
mentionKeyword = strings.ReplaceAll(mentionKeyword, "\"", "\"\"")
|
||||
buf.WriteString("\"" + mentionKeyword + "\"")
|
||||
|
|
|
|||
|
|
@ -278,11 +278,11 @@ func InitConf() {
|
|||
if 1 > Conf.Search.Limit {
|
||||
Conf.Search.Limit = 64
|
||||
}
|
||||
if 1 > Conf.Search.BacklinkMentionLimit {
|
||||
Conf.Search.BacklinkMentionLimit = 512
|
||||
if 1 > Conf.Search.BacklinkMentionKeywordsLimit {
|
||||
Conf.Search.BacklinkMentionKeywordsLimit = 512
|
||||
}
|
||||
if 1 > Conf.Search.VirtualRefLimit {
|
||||
Conf.Search.VirtualRefLimit = 512
|
||||
if 1 > Conf.Search.VirtualRefKeywordsLimit {
|
||||
Conf.Search.VirtualRefKeywordsLimit = 512
|
||||
}
|
||||
|
||||
if nil == Conf.Stat {
|
||||
|
|
|
|||
|
|
@ -110,8 +110,8 @@ func getVirtualRefKeywords(docName string) (ret []string) {
|
|||
ret = gulu.Str.ExcludeElem(ret, []string{docName})
|
||||
ret = prepareMarkKeywords(ret)
|
||||
|
||||
if Conf.Search.VirtualRefLimit < len(ret) {
|
||||
ret = ret[:Conf.Search.VirtualRefLimit]
|
||||
if Conf.Search.VirtualRefKeywordsLimit < len(ret) {
|
||||
ret = ret[:Conf.Search.VirtualRefKeywordsLimit]
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue