Skip to content

Support /multi-search (.multiSearch(...)) to allow cross-index search #210

Open

Description

@tats-u

https://www.meilisearch.com/docs/reference/api/multi_search

The /multisearch (searchClient().multiSearch(...)) endpoint allows for displaying a single search result by mixing results from multiple search queries with prioritized weighting.

When a single site provides multiple types of documents with different indexes, it is reasonable for search to mix:

  • Search results for the current document (high priority, main)
  • Search results for other documents (low priority, supplementary)

while considering their priorities. However, the current /indexes/<index>/search (searchClient().index(index).search(...)) endpoint does not support searching across multiple indexes in this manner.

Question: how do we design the props of DocSearch(Modal) to switch from .index(...).search(...) to .multiSearch(..)?

Activity

  1. changed the title [-]Support `/multi-search` to allow across-index search[/-] [+]Support `/multi-search` (`.multiSearch(...)`) to allow across-index search[/+] on Feb 20, 2026
  2. changed the title [-]Support `/multi-search` (`.multiSearch(...)`) to allow across-index search[/-] [+]Support `/multi-search` (`.multiSearch(...)`) to allow cross-index search[/+] on Feb 20, 2026
  3. amrbashir commented on Feb 21, 2026

    @amrbashir
    Member

    We could either add DocSearchMultiSearch which is explicit or we could change indexUid in DocSearchProps to be string | string[] and in the case of it being an array we use .multiSearch(..)

    I am leaning towards the latter.

  4. tats-u commented on Feb 22, 2026

    @tats-u
    Author

    DocSearchMultiSearch

    We want to reuse the logic in DocSearchModal except for a part of search() as much as possible. We sometimes want to adjust weight in federationOptions in each index in the "queries". q there can be a function (<search box string>: string) => string (value actually passed to q in API). If such a function is not passed, q should be the same as the search box string like the current single index search.

    The argument of multiSearch is highly customizable, so it is likely to be difficult to come up with the best design.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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