Skip to main content

fuse

Function fuse 

Source
pub fn fuse<K, V, L, VectorJoin, LexicalJoin>(
    query: &HybridQuery,
    vector: &[VectorCandidate<V>],
    lexical: &[LexicalCandidate<L>],
    vector_join: VectorJoin,
    lexical_join: LexicalJoin,
) -> Result<FusionOutcome<K>, FusionError>
where K: Clone + Ord, VectorJoin: FnMut(&V) -> Option<K>, LexicalJoin: FnMut(&L) -> Option<K>,
Expand description

Fuses two ranked, exactly-scored candidate lists on a caller-defined key.

Vector scores must be ascending exact squared-L2 and lexical scores must be descending exact BM25. Tie order in either input is irrelevant: fused ties use the ordered common key.