You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support /multi-search (.multiSearch(...)) to allow cross-index search #210
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(..)?
changed the title [-]Support `/multi-search` to allow across-index search[/-][+]Support `/multi-search` (`.multiSearch(...)`) to allow across-index search[/+]on Feb 20, 2026
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
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(..)
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.
Activity
[-]Support `/multi-search` to allow across-index search[/-][+]Support `/multi-search` (`.multiSearch(...)`) to allow across-index search[/+][-]Support `/multi-search` (`.multiSearch(...)`) to allow across-index search[/-][+]Support `/multi-search` (`.multiSearch(...)`) to allow cross-index search[/+]amrbashir commentedon Feb 21, 2026
We could either add
DocSearchMultiSearchwhich is explicit or we could changeindexUidinDocSearchPropsto bestring | string[]and in the case of it being an array we use.multiSearch(..)I am leaning towards the latter.
tats-u commentedon Feb 22, 2026
We want to reuse the logic in
DocSearchModalexcept for a part ofsearch()as much as possible. We sometimes want to adjustweightinfederationOptionsin each index in the "queries".qthere can be a function(<search box string>: string) => string (value actually passed to q in API). If such a function is not passed,qshould be the same as the search box string like the current single index search.The argument of
multiSearchis highly customizable, so it is likely to be difficult to come up with the best design.