Manage Search Indexes in Medusa Admin
In this guide, you’ll learn how to view your store’s search indexes and rebuild them in the Medusa Admin.
Overview#
A search index is a copy of some of your store’s data, such as your products, that your storefront searches instead of querying your database directly. This makes search results faster and ranks them by how well they match what the customer typed.
Your technical team decides which data each index holds. In the Medusa Admin, you can see the indexes they set up and rebuild any of them.
View Search Indexes#
To view your store’s search indexes, go to Settings → Search.
Each index shows in its own card with the following details:
- The index’s name, such as product.
- Provider: the search service that stores this index, such as Medusa Search or PostgreSQL.
- The index’s status, shown as a badge.
- Indexed fields: the data that the index holds, such as
titleordescription. Hover over a field to see its type and what customers can do with it, such as search, filter, or sort by it. - The Reindex button, which rebuilds the index. Refer to Reindex a Search Index.
Most Medusa stores have a product index that your technical team set up. They can also set up other search indexes for other entities, such as brands or orders.
Index Statuses#
Status | Description |
|---|---|
Pending | The index is set up, but Medusa hasn’t built it yet. |
Building | Medusa is currently building the index. Search results for this index may be incomplete until the build finishes. |
Ready | The index is up to date, and customers can search it. |
Error | Medusa couldn’t build the index. Rebuild the index, and if the error persists, contact your technical team. |
Reindex a Search Index#
Medusa keeps an index up to date as your data changes, so you rarely need to rebuild one. Rebuild an index, which is also called reindexing, in the following cases:
- Search results show data that you already changed or deleted.
- Search results miss items that you expect to find.
- The index’s status is "Error".
To rebuild an index:
- Go to Settings → Search.
- Find the index you want to rebuild.
- Click the Reindex button in the index’s card. The button is disabled while the index’s status is "Building".
- In the window that opens, set the following optional fields:
- Since: choose a date and time to rebuild only the data that changed at or after that point. Leave this field empty to rebuild the whole index.
- Entity IDs: enter the IDs of the items you want to rebuild, separated by commas or new lines. Leave this field empty to rebuild the whole index.
- Click the Reindex button.
Medusa then rebuilds the index from your store’s data. Search results for that index may be incomplete while the status is "Building", and a large index can take a while to finish.