Versions in this module Expand all Collapse all v1 v1.2.0 Jun 6, 2026 v1.1.0 Jun 3, 2026 Changes in this version + type Config struct + KeywordFields []string + MinScore float64 + RerankCandidates int + Reranker Reranker + Search SearchEngine + Strategy Strategy + TopK int + Vector VectorRetriever + VectorWeight float64 + type Document struct + Content string + ID string + Metadata map[string]string + Score float64 + type RerankResult struct + Index int + Score float64 + type Reranker interface + Rerank func(ctx context.Context, query string, documents []string, topN int) ([]RerankResult, error) + type SearchEngine interface + Search func(ctx context.Context, query string, fields []string, size int) ([]SearchHit, error) + type SearchHit struct + Fields map[string]interface{} + ID string + Score float64 + type Strategy string + const StrategyHybrid + const StrategyKeyword + const StrategyVector + type StrategyRetriever struct + func New(cfg Config) (*StrategyRetriever, error) + func (r *StrategyRetriever) Retrieve(ctx context.Context, query string, topK int) ([]*Document, error) + type VectorRetriever interface + Retrieve func(ctx context.Context, query string, topK int) ([]*Document, error)