Use SearchCue with InstantSearch.js
SearchCue exposes an InstantSearch-compatible endpoint for sites that already use Algolia's UI widgets and want SearchCue to answer the search requests.
Endpoint
Send InstantSearch multi-query requests with POST to
https://edge.searchcue.com/api/search/instantsearch/YOUR_SITE_ID.
Replace YOUR_SITE_ID with your SearchCue Site ID.
Drop in a small custom client.
InstantSearch accepts any object with a search(requests)
method. Use this adapter with a SearchCue Site ID from your admin pages.
Select one of your sites to get a copyable InstantSearch client preconfigured with the right Site ID.
const siteId = "site_abc123";
const searchClient = {
async search(requests) {
const endpoint = `https://edge.searchcue.com/api/search/instantsearch/${siteId}`;
const response = await fetch(endpoint, {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ requests }),
});
if (!response.ok) {
const error = await response.json().catch(() => ({}));
throw new Error(error.message || `SearchCue search failed with ${response.status}`);
}
return response.json();
},
};
const search = instantsearch({
indexName: "searchcue",
searchClient,
}); Demo
We have a rudimentary demo showing InstantSearch using the SearchCue backend that you can play with right on this page.
The search results are the same as those you would get by using the native SearchCue search interface in the navigation at the top of the page.
The demo will search the site selected above: .
Search SearchCue with InstantSearch.js
Results come from
https://edge.searchcue.com/api/search/instantsearch/site_SearchCueSearchProd.
Supported widgets
SearchCue supports the ordinary search flow used by
searchBox, hits, pagination,
and infiniteHits.
Facets, filter menus, searchable facet values, recommendations, Insights events, and refinement widgets are not supported by this endpoint.
Request shape
SearchCue accepts Algolia-style { requests } payloads.
Each request can pass params as a URL-encoded string or
as an object.
{
"requests": [
{
"indexName": "searchcue",
"params": "query=garden&page=0&hitsPerPage=20"
}
]
}