Description
Here is the code to reproduce the bug:
const client = algoliasearch("*******", "********");
const response = await client.search<{ title: string }>({
requests: [
{
indexName: "first_index",
query,
hitsPerPage: 5,
},
{
indexName: "second_index",
query,
hitsPerPage: 5,
},
{
indexName: "third_index",
query,
hitsPerPage: 5,
},
],
});

It seems that the SearchResult type only takes SearchForFacetValuesResponse into account.
In the source code, the following typing is used:
type SearchResult<T = Record<string, unknown>> = SearchResponse<T> | SearchForFacetValuesResponse;
Do you think the following patch might work?
type SearchResult<T = Record<string, unknown>> = SearchResponse<T> & SearchForFacetValuesResponse;
Client
Search
Version
5.23.4
Relevant log output
Description
Here is the code to reproduce the bug:
It seems that the
SearchResulttype only takesSearchForFacetValuesResponseinto account.In the source code, the following typing is used:
type SearchResult<T = Record<string, unknown>> = SearchResponse<T> | SearchForFacetValuesResponse;Do you think the following patch might work?
type SearchResult<T = Record<string, unknown>> = SearchResponse<T> & SearchForFacetValuesResponse;Client
Search
Version
5.23.4
Relevant log output