MiniSearch | MiniSearch (original) (raw)

Type Parameters

Index

Constructors

constructor

Returns MiniSearch<T>

Properties

Static Readonly wildcard

Accessors

dirtCount

dirtFactor

documentCount

isVacuuming

termCount

Methods

add

addAll

Returns void

addAllAsync

Returns Promise<void>

A promise resolving to undefined when the indexing is done

autoSuggest

A sorted array of suggestions sorted by relevance score.

discard

discardAll

Returns void

getStoredFields

has

remove

removeAll

Returns void

replace

Returns void

toJSON

A plain-object serializable representation of the search index.

vacuum

Static getDefault

Returns any

The default value of the given option

Usage:

// Get default tokenizer  
MiniSearch.getDefault('tokenize')  
// Get default term processor  
MiniSearch.getDefault('processTerm')  
// Unknown options will throw an error  
MiniSearch.getDefault('notExisting')  
// => throws 'MiniSearch: unknown option "notExisting"'  

Static loadJSON

Parameters

Returns MiniSearch<T>

An instance of MiniSearch deserialized from the given JSON.

Static loadJSONAsync

Parameters

Returns Promise<MiniSearch<T>>

A Promise that will resolve to an instance of MiniSearch deserialized from the given JSON.