Defined in: packages/inverted-index/src/inverted-index.ts:5
Immutable association from exact keys to the zero-based IDs of records that contained them.
Type Parameters
Section titled “Type Parameters”K
Properties
Section titled “Properties”
readonlysize:number
Defined in: packages/inverted-index/src/inverted-index.ts:7
Number of distinct keys. O(1).
recordCount
Section titled “recordCount”
readonlyrecordCount:number
Defined in: packages/inverted-index/src/inverted-index.ts:9
Number of input records, including records with no keys. O(1).
postings
Section titled “postings”
readonlypostings: (key) =>IterableIterator<number>
Defined in: packages/inverted-index/src/inverted-index.ts:11
A fresh iterator of matching record IDs, ascending and unique. A missing key yields an empty iterator.
Parameters
Section titled “Parameters”K
Returns
Section titled “Returns”IterableIterator<number>
readonlykeys: () =>IterableIterator<K>
Defined in: packages/inverted-index/src/inverted-index.ts:13
A fresh iterator of keys in first-seen order.
Returns
Section titled “Returns”IterableIterator<K>
entries
Section titled “entries”
readonlyentries: () =>IterableIterator<readonly [K,IterableIterator<number,any,any>]>
Defined in: packages/inverted-index/src/inverted-index.ts:15
A fresh iterator of keys paired with independent posting iterators, in first-seen key order.
Returns
Section titled “Returns”IterableIterator<readonly [K, IterableIterator<number, any, any>]>
[iterator]
Section titled “[iterator]”
readonly[iterator]: () =>IterableIterator<readonly [K,IterableIterator<number,any,any>]>
Defined in: packages/inverted-index/src/inverted-index.ts:17
The same function as entries.
Returns
Section titled “Returns”IterableIterator<readonly [K, IterableIterator<number, any, any>]>
forEachAny
Section titled “forEachAny”
readonlyforEachAny: (keys,visit) =>void
Defined in: packages/inverted-index/src/inverted-index.ts:23
Visit each record matching any query key once, in ascending order. An empty query visits nothing. With k query keys and u matching records, uses O(k) temporary space and O(k × (u + 1)) time. Each call owns its cursors. The visitor can query the index recursively. Visitor and iterable errors propagate.
Parameters
Section titled “Parameters”Iterable<K>
(id) => void
Returns
Section titled “Returns”void