Service to convert Algolia Query Suggestions to OpenSearch Suggestions.
MIT License
Service to convert Algolia Query Suggestions to OpenSearch Suggestions.
Picture of Firefox showing Algolia Query Suggestions from the URL bar with OpenSearch Suggestions.
https://your-website.com/.netlify/functions/suggestions?query=iphone&appId=appId&apiKey=apiKey&indexName=indexName&hitsPerPage=3
["iphone",["iphone","iphone 6s","iphone gray"]]
<OpenSearchDescription
xmlns="http://a9.com/-/spec/opensearch/1.1/"
xmlns:moz="http://www.mozilla.org/2006/browser/search/"
>
<!-- ... -->
<!-- Replace the query parameters with your Algolia credentials -->
<Url
type="application/x-suggestions+json"
template="https://your-website.com/.netlify/functions/suggestions?query={searchTerms}&appId=latency&apiKey=6be0576ff61c053d5f9a3225e2a90f76&indexName=instant_search_demo_query_suggestions&hitsPerPage=10"
/>
</OpenSearchDescription>
opensearch.xml
<html>
<head>
<link
rel="search"
type="application/opensearchdescription+xml"
href="opensearch.xml"
title="Search app"
/>
<!-- ... -->
</head>
<body>
<!-- ... -->
</body>
</html>
index.html