flexsearch
flexsearch copied to clipboard
`IndexOptions` TS interface is missing some options
The new type definitions are incredible. However it is missing some described, but not explicitly documented Index Options.
From Memory Allocation section: minlength: number, fastupdate: boolean
From Right-To-Left Support section: rtl: boolean
I've also noticed that DocumentOptions interface has id as required field, however it can be left empty to default to "id".
Until this is resolved you can patch the IndexOptions type definition and include the missing properties that you want to use.
In my case I wanted to use the minlength property.
import FlexSearch from 'flexsearch'
declare module 'flexsearch' {
interface IndexOptions<T, Store extends StoreOption = false> {
minlength?: number;
}
}