Install the search adapter
1
Install with Composer
2
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.
3
Set Algolia as the search engine
- Go to Stores > Configuration > Catalog > Catalog Search.
- Set Search Engine to Algolia Backend Search.
- Adjust connection and read timeouts if needed (defaults: 2 s / 5 s).
- Click Test Connection to verify connectivity.
- Save and flush cache.
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)
Events and analytics
Backend rendering serves static HTML to crawlers, LLM-based discovery tools, and other clients that don’t run JavaScript. Because there’s no client-side layer to capture user interactions, backend-rendered pages don’t send click and conversion events to Algolia, and the responses behind them don’t return aqueryID.
What this means depends on how you run the adapter:
- Standalone backend rendering (without InstantSearch). No click or conversion events are captured, so search analytics that rely on events aren’t available for these pages.
- Hybrid mode (with InstantSearch). Interactive visitors still get the full InstantSearch experience, which captures click and conversion events as usual. The server-rendered variant served to crawlers doesn’t generate events, which is expected because no client-side interactions occur.
To capture click and conversion analytics,
run the adapter in hybrid mode with InstantSearch enabled.
See Click and conversion events
to set up tracking.
Why backend rendering doesn’t capture a queryID
Backend-rendered pages don’t generate click and conversion events. This is expected because backend-rendered pages are served from a shared cache, so they can’t reliably associate events with an individual search. To avoid incorrect analytics, the adapter doesn’t enable click analytics for backend-rendered queries.
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.
To configure, go to
Stores > Configuration > Algolia Search > InstantSearch > Backend Search Compatibility > Query string parameters.
Backend rendering modes
Backend rendering controls whether Magento renders product listings on the server before delivering the page.
To configure, go to
Stores > Configuration > Algolia Search > InstantSearch > Backend Search Compatibility.
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.