Skip to main content
A unified search bar queries multiple indexes and presents all results in one interface. Depending on your needs, you can display results in categorized sections (multi-index mode) or as a single merged list (federated mode). This page walks through both patterns and shows how to implement them in a frontend application.

Choose a display mode

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 the federation parameter:
Each query limits results and selects only the fields needed for the search bar display.

Frontend implementation

Here is a simple JavaScript pattern for rendering categorized results:
Use federated search when you want a single ranked list where the most relevant results appear first, regardless of which index they come from.
The response returns a flat 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