Skip to main content
topk-js / query_fn

Functions

bm25Score()

Computes the BM25 score for a keyword search. Parameters Returns FunctionExpression

multiVectorDistance()

Calculate the multi-vector distance between a field and a query matrix. The query matrix can be an array of number arrays (defaults to f32), or a Matrix instance. To specify a different matrix type, use matrix() with valueType. The optional candidates parameter limits the number of candidate vectors considered during retrieval.
Parameters Returns FunctionExpression

semanticSimilarity()

Computes the semantic similarity between a field and a query string. Parameters Returns FunctionExpression

vectorDistance()

Computes the vector distance between a field and a query vector. Parameters Returns FunctionExpression

Interfaces

Bm25ScoreOptions

Options for BM25 scoring. Properties

VectorDistanceOptions

Properties