mirror of
https://github.com/krisk/Fuse.git
synced 2026-01-25 16:43:11 +00:00
584 B
584 B
| tags | |
|---|---|
|
Indexing
Use Fuse.createIndex to pre-generate the index from the list, and pass it directly into the Fuse instance.
const list: MyType[] = [myType1, myType2, etc...]
const index = Fuse.createIndex<MyType>(
keys: ['key1', 'key2']
list: list
)
const options: Fuse.IFuseOptions<MyType> = {
keys: ['key1', 'key2']
}
const myFuse = new Fuse(list, options, index)
::: tip
For very large datasets, especially those with large strings, consider pre-generating the index with Fuse.createIndex. This will speed up instantiation.
:::