refactor(mcp-go): 拆除 search.Hybrid 残骸(T4.F)

- search.Hybrid 空转(NewHybrid 返空、Query 返 nil TODO)、构造后存进 Gateway
  却从不被调用(真实 RAG 走 rag.Engine)→ 纯误导性死重量
- 删 internal/search 包 + gateway.go 字段/构造参数 + main.go 接线
- build/vet 干净;wiki_search 不受影响(本就用 g.rag)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Blizzard
2026-07-02 13:39:14 +08:00
parent 7c211719d2
commit 6095bc71d2
4 changed files with 5 additions and 39 deletions
+2 -4
View File
@@ -21,13 +21,11 @@ import (
"github.com/sundynix/sundynix-mcp-go/internal/memory"
"github.com/sundynix/sundynix-mcp-go/internal/office"
"github.com/sundynix/sundynix-mcp-go/internal/rag"
"github.com/sundynix/sundynix-mcp-go/internal/search"
)
// Gateway 暴露 MCP 协议端点,经共享 bus 订阅 sundynix.tools.go.* 响应调用。
type Gateway struct {
bus *sharedbus.Bus
search *search.Hybrid
memory *memory.Store
history *history.Store
rag *rag.Engine
@@ -60,8 +58,8 @@ type toolDef struct {
handler func(context.Context, *contract.ToolCall) *contract.ToolResult
}
func NewGateway(b *sharedbus.Bus, s *search.Hybrid, m *memory.Store, h *history.Store, r *rag.Engine, pgDSN string) *Gateway {
g := &Gateway{bus: b, search: s, memory: m, history: h, rag: r, pgDSN: pgDSN}
func NewGateway(b *sharedbus.Bus, m *memory.Store, h *history.Store, r *rag.Engine, pgDSN string) *Gateway {
g := &Gateway{bus: b, memory: m, history: h, rag: r, pgDSN: pgDSN}
g.tools = g.buildRegistry()
return g
}
-30
View File
@@ -1,30 +0,0 @@
// Package search 实现 LLM Wiki 混合检索引擎。
// Hybrid Search = Bleve(全文/BM25) + Milvus(向量) + Neo4j(知识图谱) 融合排序。
package search
import "context"
// Hybrid 聚合三路检索后端并做 RRF/加权融合。
type Hybrid struct {
// bleve *bleve.Index // Go 全文检索
// milvus client.Client // Vector DB (Milvus Go SDK)
// neo4j neo4j.DriverWithContext // Knowledge Graph
}
func NewHybrid() *Hybrid {
// TODO: 打开 bleve 索引;连接 Milvus;连接 Neo4j
return &Hybrid{}
}
// Result 是融合后的检索结果。
type Result struct {
ID string
Score float64
Text string
}
// Query 并行查询三路后端并融合排序。
func (h *Hybrid) Query(ctx context.Context, q string, topK int) ([]Result, error) {
// TODO: 并发 bleve.Search + milvus.Search + neo4j Cypher,做 RRF 融合
return nil, nil
}