A search box rarely searches one thing. The shopper who types «returns» wants the policy page, not a product; the one who types «air fryer» wants products first and recipes second. Federated search sends one request, runs each collection with its own parameters, and answers in one response — one network round trip instead of one per content type.
Products, articles and help pages have different schemas, ranking and update cycles — they stay separate collections.
Send a searches array to multi_search. Every entry names its collection and carries its own query_by, filters and page size.
By default you get one result set per search — ideal for a sectioned dropdown. Set union: true to merge everything into a single ordered list.
Grouped results map directly onto a sectioned autocomplete: «Products», «Guides», «Help», each with its own count and its own «show all». Merged results suit a universal results page where the best answer should win regardless of type.
Because every search in the batch keeps its own parameters, products can be filtered by stock and boosted by margin while help articles are searched by title and body only — no lowest-common-denominator schema.
A browser key lists the collections it may search. The storefront holds one short-lived key, and a request for a collection outside that list is refused on the server — federated search does not widen access.
Each entry has its own query_by, filter_by, sort_by, preset and page size.
union: true merges the hits of every search into a single ordered set.
A failing search returns its own error code inside the batch; the other result sets still arrive.
Search rules, experiments and the debug trace apply to multi_search exactly as they do to a single-collection search.
{
"searches": [
{ "collection": "products", "q": "air fryer", "query_by": "name,brand",
"filter_by": "in_stock:true", "per_page": 6 },
{ "collection": "recipes", "q": "air fryer", "query_by": "title,body", "per_page": 3 },
{ "collection": "help", "q": "air fryer", "query_by": "title", "per_page": 2 }
]
}
// -> { "results": [ { products… }, { recipes… }, { help… } ] }Explore more
The best way to evaluate a search platform isn't reading one more comparison table.
Only then make the decision.