From ee788ee28a2b45bca40cd80862981be872495647 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Sat, 26 Oct 2024 12:39:10 +0800 Subject: [PATCH] :zap: Return document blocks when search hits different block content https://github.com/siyuan-note/siyuan/issues/10584 --- kernel/model/search.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/kernel/model/search.go b/kernel/model/search.go index fd5de75eb..d5bd8d608 100644 --- a/kernel/model/search.go +++ b/kernel/model/search.go @@ -1441,9 +1441,8 @@ func fullTextSearchByFTSWithRoot(query, boxFilter, pathFilter, typeFilter, ignor } if 0 < len(resultBlocks) { matchedRootCount = int(result[0]["docs"].(int64)) + matchedBlockCount = matchedRootCount } - logging.LogInfof("time cost [main search]: %v", time.Since(start)) - now := time.Now() keywords = gulu.Str.RemoveDuplicatedElem(keywords) terms := strings.Join(keywords, search.TermSep) @@ -1452,7 +1451,6 @@ func fullTextSearchByFTSWithRoot(query, boxFilter, pathFilter, typeFilter, ignor ret = []*Block{} } - logging.LogInfof("time cost [highlight search]: %v", time.Since(now)) logging.LogInfof("time cost [all]: %v", time.Since(start)) return }