fusion

package
v2.5.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FusionResult

type FusionResult struct {
	Hits     search.DocumentMatchCollection
	Total    uint64
	MaxScore float64
}

func ReciprocalRankFusion

func ReciprocalRankFusion(hits search.DocumentMatchCollection, weights []float64, rankConstant int, windowSize int, numKNNQueries int, explain bool) *FusionResult

ReciprocalRankFusion applies Reciprocal Rank Fusion across the primary FTS results and each KNN sub-query. Ranks are limited to `windowSize` per source, weighted, and combined into a single fused score, with optional explanation details.

func RelativeScoreFusion

func RelativeScoreFusion(hits search.DocumentMatchCollection, weights []float64, windowSize int, numKNNQueries int, explain bool) *FusionResult

RelativeScoreFusion normalizes the best-scoring documents from the primary FTS query and each KNN query, scales those normalized values by the supplied weights, and combines them into a single fused score. Only the top `windowSize` documents per source are considered, and explanations are materialized lazily when requested.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL