Skip to content

Graphorin API reference v0.1.0


Graphorin API reference / @graphorin/tools / / defineBm25Index

Function: defineBm25Index()

ts
function defineBm25Index(docs, opts?): (query, k?) => Bm25Match[];

Defined in: packages/tools/src/registry/bm25.ts:100

Build a BM25 query function over docs. The returned function runs in O(query tokens × matching docs) per invocation — bounded by the registry size.

Parameters

ParameterType
docsreadonly Bm25Document[]
optsBm25Options

Returns

(query, k?) => Bm25Match[]

Stable