This is the React InstantSearch v7 documentation.
If you’re upgrading from v6, see the upgrade guide.
If you were using React InstantSearch Hooks,
this v7 documentation applies—just check for necessary changes.
To continue using v6, you can find the archived documentation.
<Index
indexName={string}
// Optional props
indexId={string}
/>
Import
import { Index } from "react-instantsearch";
<Index> is the provider component for an Algolia index.
It’s useful when building interfaces that target multiple indices such as federated searches.
The position of <Index> in the widget tree affects which search parameters apply.
Widgets that create search parameters forward them to their children <Index> widgets.
Examples
import React from "react";
import { liteClient as algoliasearch } from "algoliasearch/lite";
import { InstantSearch, Index } from "react-instantsearch";
const searchClient = algoliasearch("YourApplicationID", "YourSearchOnlyAPIKey");
function App() {
return (
<InstantSearch indexName="instant_search" searchClient={searchClient}>
{/* Widgets */}
<Index indexName="instant_search_demo_query_suggestions">
{/* Widgets */}
</Index>
</InstantSearch>
);
}
Props
The main index to search into.<Index indexName="instant_search">{/* Widgets */}</Index>;
An identifier for the <Index> widget.Providing an indexId lets different <Index widgets target the same Algolia index.
It’s helpful for routing.
It lets you find the refinements that match an <Index> widget.<Index
// ...
indexId="instant_search"
>
{/* Widgets */}
</Index>;
Last modified on January 28, 2026