Skip to content

MultiSearchResponse type does not account for union search response shape #128

@rabingaire

Description

@rabingaire

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions