The MultiSearchResponse type in src/typesense/types/multi_search.py only models the federated (default) multi-search response shape:
class MultiSearchResponse(typing.TypedDict):
results: typing.List[SearchResponse[typing.Any]]
However, the /multi_search endpoint has two distinct response shapes depending on whether union is set in the request:
- Federated search (union absent or False):
returns { "results": [ ...one SearchResponse per query... ] }
- Union search (union: True): returns with no results wrapper doc
The current type is incorrect for the union case and gives users a misleading return type annotation when they call multi_search.perform() with union=True.
The
MultiSearchResponsetype in src/typesense/types/multi_search.py only models the federated (default) multi-search response shape:However, the
/multi_searchendpoint has two distinct response shapes depending on whether union is set in the request:returns { "results": [ ...one SearchResponse per query... ] }The current type is incorrect for the union case and gives users a misleading return type annotation when they call
multi_search.perform()withunion=True.