Install the search adapter
Configure Algolia credentials
If you havenât already, go to
Stores > Configuration > Algolia Search > Credentials and Basic Setup
and enter your Algolia Application ID and API keys.
The adapter uses the same credentials as the main extension.
You donât need to uninstall Elasticsearch or OpenSearch.
Changing the search engine setting is enough.
Magento routes all search queries to whichever engine is selected.
Work with and without InstantSearch
The adapter can operate in two ways:- Without InstantSearch (pure server-side rendering). Magento renders product listings and layered navigation entirely on the server. This is useful if you donât need client-side search features or want a lightweight setup for SEO.
- With InstantSearch (hybrid mode). Server-rendered pages are delivered to bots and non-JS clients, while human visitors get the full InstantSearch experience. The adapter respects your existing InstantSearch facet and sorting configuration, so both rendering paths return consistent results.
Supported pages and limitations
The adapter handles two page types:- Quick search results (
catalogsearch/result) - Category pages (product listings)
SEO-friendly filters
By default, Magento encodes filter selections as internal option IDs:Query string parameter parity
When a crawler indexes a backend-rendered URL like?product_list_order=price~asc&p=2&cat=5&price=10-50,
a human visitor opening the same URL should get identical results from InstantSearch.
The query string parameters setting ensures both modes use matching URL parameter names.
| Parameter | Algolia default mode | Magento compatibility mode (default) |
|---|---|---|
| Sorting | sortBy | product_list_order |
| Pagination | page | p |
| Category | categories | cat |
| Price | price.{priceKey} with : separator | price with - separator |
Backend rendering modes
Backend rendering controls whether Magento renders product listings on the server before delivering the page.| Mode | Behavior |
|---|---|
| No (default) | InstantSearch handles all rendering client-side. |
| Yes (for all users) | The server renders results for every request. |
| Yes, for specific User Agents | The server renders only when the requestâs User-Agent matches the allow list. |
User-agent allow list
When the rendering mode is set to specific User Agents, you can configure which user agents receive server-rendered pages. Enter one user-agent string per line. Matching is partial and case-insensitive. For example,Googlebot matches Mozilla/5.0 (compatible; Googlebot/2.1; ...).
The defaults are Googlebot and Bingbot.
Cache context
When backend rendering targets specific user agents, the module adds analgolia_rendering_context value
(with_backend or without_backend) to Magentoâs X-Magento-Vary cookie.
This tells Magentoâs full-page cache to store separate cached pages
for bot visitors and human visitors,
so each group gets the correct rendering.
This context only applies when InstantSearch is configured to replace category pages.
Varnish and user-agent caching
When using the specific User Agents mode behind Varnish, be aware of an important caching interaction. The module uses theX-Magento-Vary cookie to differentiate bot and human requests.
This works with Magentoâs built-in full-page cache.
However, search-engine crawlers donât carry cookies,
so Varnish has no X-Magento-Vary value to distinguish bot requests from human requests on cache hits.
Without intervention, Varnish may serve the wrong cached variant.
If this were to happen, a human could see the bot (backend-rendered) page,
or a crawler could see the JavaScript-only page.
This can be addressed in one of three ways:
-
Custom VCL snippet (recommended).
Add a VCL rule that inspects the
User-Agentheader and synthesizes or overrides the vary hash for known bot user agents. This ensures Varnish serves the correct variant without relying on cookies. - Use âYes (for all users)â mode. When every visitor gets the same server-rendered page, thereâs no variant mismatch to worry about.
- Bypass Varnish for bot traffic. Route known bot user agents directly to the Magento backend, skipping Varnish entirely.