Choose a display mode
| Mode | Best for | Result format |
|---|---|---|
| Multi-index | Showing results grouped by type (products section, articles section) | Separate result arrays |
| Federated | Showing a single ranked list across all content types | One merged array |
Option 1: categorized sections with multi-index search
Use multi-index search when you want to display results from each index in its own section. This gives you full control over how each category appears. Send a multi-search request without thefederation parameter:
Frontend implementation
Here is a simple JavaScript pattern for rendering categorized results:Option 2: merged list with federated search
Use federated search when you want a single ranked list where the most relevant results appear first, regardless of which index they come from.hits array. Each hit includes a _federation object that tells you which index it came from:
Frontend implementation
Use the_federation.indexUid field to style each result according to its type:
Which mode should you use?
- Categorized sections work well when users expect to see clear separation between content types, like a sidebar with “Products”, “Articles”, and “Help” sections
- Merged list works well for a single search bar where the most relevant result should always appear first, regardless of type
- You can also combine both: use federated search for the main results and multi-index search for a “quick suggestions” dropdown
Next steps
Multi-index search
Learn the basics of multi-index search
Federated search
Learn how to set up federated search
Boost results
Use weights to prioritize results from specific indexes