| | |
| | | |
| | | "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" |
| | | ) |
| | |
| | | } |
| | | |
| | | // 执行搜索 |
| | | 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) |