You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
npm i -D typescript
npm i flexsearch
npx tsc test-pluck.ts
Result (error):
test-pluck.ts:14:19 - error TS2769: No overload matches this call.
Overload 1 of 4, '(query: string, limit?: number): SimpleDocumentSearchResultSetUnit[]', gave the following error.
Argument of type '{ pluck: string; enrich: boolean; }' is not assignable to parameter of type 'number'.
Overload 2 of 4, '(query: string, options: string[] | Partial<DocumentSearchOptions<boolean>>): SimpleDocumentSearchResultSetUnit[]', gave the following error.
Object literal may only specify known properties, and 'pluck' does not exist in type 'string[] | Partial<DocumentSearchOptions<boolean>>'.
Overload 3 of 4, '(query: string, limit?: number, options?: Partial<DocumentSearchOptions<false>>): SimpleDocumentSearchResultSetUnit[]', gave the following error.
Argument of type '{ pluck: string; enrich: boolean; }' is not assignable to parameter of type 'number'.
14 const res = index.search(query, { pluck: "title", enrich: true });
~~~~~~
Found 1 error in test-pluck.ts:14
The text was updated successfully, but these errors were encountered:
The README.md says:
However, actually using this option in a TypeScript code (by copy-and-pasting the example) resulted in an error.
Environment:
Source file
test-pluck.ts
:Commands:
Result (error):
The text was updated successfully, but these errors were encountered: