From b554c303193aa5d22af5f8a4b91430077113e6db Mon Sep 17 00:00:00 2001
From: ax_rd <ax_rd@aisim.cn>
Date: Thu, 03 Sep 2026 13:21:36 +0800
Subject: [PATCH] fix: search 长 CJK 词 bigram 展开统一下沉(ExpandCJKKeywords 共享 + textScore 按 Expanded 档计权 + graph query 边 provenance 填充)
---
cmd/search.go | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/cmd/search.go b/cmd/search.go
index 7083750..379d3cf 100644
--- a/cmd/search.go
+++ b/cmd/search.go
@@ -7,6 +7,7 @@
"github.com/aisim/kb-cli/internal/index"
"github.com/aisim/kb-cli/internal/search"
+ "github.com/aisim/kb-cli/internal/llm"
"github.com/aisim/kb-cli/internal/output"
"github.com/spf13/cobra"
)
@@ -76,12 +77,18 @@
}
// 执行搜索
+ cfg := llm.LoadConfig()
+ textWeight := cfg.Search.TextWeight
+ if textWeight <= 0 || textWeight > 1 {
+ textWeight = 0.5 // 缺省 0.5
+ }
opts := search.SearchOptions{
Expanded: expanded,
Symptom: symptom,
TopN: topN,
WithContent: withContent,
WithLinks: withLinks,
+ TextWeight: textWeight,
}
results, err := search.Search(store, allKeywords, opts)
--
Gitblit v1.10.0