Hello, I'm trying to use `client.multiSearch` in a...
# community-help
y
Hello, I'm trying to use
client.multiSearch
in a TypeScript project, and I can't find how to provide types to multisearch so that the search response is typed, as can be done for
client.collections<MyDocumentSchema>
Is this currently possible at all?
If it's not implemented yet, I'd see the generic be moved to the perform function rather than carried by the MultiSearch class, which the user never instantiates
If that’s not working as intended, definitely open to a PR that fixes the type def
y
Yes it exists, but the generic type is defined at the class level
Copy code
export default class MultiSearch<T extends DocumentSchema = {}> {
[...]
}
The class is never instantiated by the user, it is instantiated during client initialization, without types. My suggestion would be to set the generic argument definition in the
perform
function I'll create a PR to suggest a fix, thanks !