Kind: Class
Source: atloria-monorepo/libs/agent-core/src/semantic/bm25.ts
Methods
| Method | Signature | Returns |
|---|---|---|
addDocument | addDocument(id: string, text: string) | void |
removeDocument | removeDocument(id: string) | void |
search | search(query: string, topK: undefined) | Array<{ id: string; score: number }> |
clear | clear() | void |
serialize | serialize() | SerializedIndex |
deserialize | deserialize(data: object) | BM25Index |
Where it refuses work
BM25Indexstops the work with an early return whendocLen === undefined.BM25Indexstops the work with an early return whenqueryTokens.length === 0 || this.documentCount === 0.BM25Indexstops the work with an early return when!d.terms || !d.docLengths.
Was this page helpful?