Documentation
¶
Overview ¶
Package sparse provides sparse retrieval steps using BM25 algorithm.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Search ¶
func Search(
searcher interface {
Search(ctx context.Context, query string, topK int) ([]*Result, error)
},
topK int,
logger logging.Logger,
metrics core.Metrics,
) pipeline.Step[*core.RetrievalContext]
Search creates a new BM25 sparse search step with logger and metrics.
Parameters:
- searcher: sparse search implementation (BM25, etc.)
- topK: number of results to retrieve (default: 10)
- logger: structured logger (auto-defaults to NoopLogger if nil)
- metrics: metrics collector (optional, can be nil)
Example:
p.AddStep(sparse.Search(searcher, 20, logger, metrics))
Types ¶
Click to show internal directories.
Click to hide internal directories.