flexsearch
flexsearch copied to clipboard
get property missing from types
I get the Property 'get' does not exist on type typescript error when trying to use documentIndex.get()
Sample code:
import { Document } from 'flexsearch';
type TestDocument = {
id: number;
foo: number;
bar: string;
}
const docIndex = new Document<TestDocument>({});
docIndex.add({ id: 1, foo: 2, bar: 'test-document' });
docIndex.get(1); <--- Property 'get' does not exist on type 'Document<TestDocument, false>'.
Using "flexsearch: "^0.7.21", and "@types/flexsearch": "^0.7.3".