Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexOptions TS interface is missing some options #423

Open
thexeos opened this issue Jan 13, 2024 · 2 comments
Open

IndexOptions TS interface is missing some options #423

thexeos opened this issue Jan 13, 2024 · 2 comments

Comments

@thexeos
Copy link
Contributor

thexeos commented Jan 13, 2024

The new type definitions are incredible. However it is missing some described, but not explicitly documented Index Options.

image

From Memory Allocation section: minlength: number, fastupdate: boolean

From Right-To-Left Support section: rtl: boolean

@thexeos
Copy link
Contributor Author

thexeos commented Jan 13, 2024

I've also noticed that DocumentOptions interface has id as required field, however it can be left empty to default to "id".

image

image

@waynedunkley
Copy link

waynedunkley commented Aug 13, 2024

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;
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants