Gauthier PLM
08/26/2025, 3:45 PMInfix
parameter to the MultiSearchResponse
object.
Is there any documentation about what to provide to this parameter?
The version introduced quite a few changes to the types but no migration was documented. Great to see types improving, but not super nice to introduce breaking changes without proper doc 😛Fanis Tharropoulos
08/26/2025, 3:51 PMMultiSearchResponse
type isn't meant to be explicitly defined by the user. It also provides a default generic of string
, which passes the type check. It's meant for comma-separated stringsGauthier PLM
08/26/2025, 3:55 PMMultiSearchResponse
as parameter to a function that transform the search results to the datatype needed in the app, hence why I use it.
The TypeSense schema does not exactly match what is used in the app ; the schema was adapted to take the most of TypeSense.
Would there be a more fitting type?Gauthier PLM
08/26/2025, 3:57 PMMultiSearchResponse<Typesense.MultisearchSchemas>
With this, TS complains 2 or 3 params are required 🙂Fanis Tharropoulos
08/26/2025, 3:59 PMnpm list
Fanis Tharropoulos
08/26/2025, 4:00 PM2.1.0-13
if you're not on that?Gauthier PLM
08/26/2025, 4:00 PMGauthier PLM
08/26/2025, 4:00 PMFanis Tharropoulos
08/26/2025, 4:01 PMnpm install typesense@next
Gauthier PLM
08/26/2025, 4:02 PMGauthier PLM
08/26/2025, 4:04 PMFanis Tharropoulos
08/26/2025, 4:04 PMGauthier PLM
08/26/2025, 4:10 PMexport type MultisearchSchemas = [
CompanyDocumentSchema,
ProjectDocumentSchema,
ReportDocumentSchema,
RequestDocumentSchema,
TranscriptDocumentSchema,
];
export type MultiSearchResponse = Awaited<
ReturnType<
typeof TypeSenseMultiSearch.prototype.perform<Typesense.MultisearchSchemas>
>
>;
Gauthier PLM
08/26/2025, 4:11 PMUnionSearchResponse
), but not the non-union one.
It would be nice if the non-union version had a dedicated response type too, so I could use it directly 🙂Gauthier PLM
08/26/2025, 4:12 PMFanis Tharropoulos
08/26/2025, 4:14 PMtypeof
on the object built by the function call, you can then use thatGauthier PLM
08/26/2025, 4:27 PM