https://github.com/francoischalifour/algolia-opensearch-suggestions
Service to convert Algolia Query Suggestions to OpenSearch Suggestions.
https://github.com/francoischalifour/algolia-opensearch-suggestions
algolia opensearch query suggestions
Last synced: 5 months ago
JSON representation
Service to convert Algolia Query Suggestions to OpenSearch Suggestions.
- Host: GitHub
- URL: https://github.com/francoischalifour/algolia-opensearch-suggestions
- Owner: francoischalifour
- License: mit
- Created: 2020-09-22T11:45:40.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-10-07T21:21:51.000Z (about 5 years ago)
- Last Synced: 2025-04-11T19:53:07.713Z (8 months ago)
- Topics: algolia, opensearch, query, suggestions
- Language: TypeScript
- Homepage:
- Size: 290 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# algolia-opensearch-suggestions
Service to convert [Algolia Query Suggestions](https://www.algolia.com/doc/guides/getting-insights-and-analytics/leveraging-analytics-data/query-suggestions/) to [OpenSearch Suggestions](https://github.com/dewitt/opensearch/blob/c9ed38a524c53b61d582634b28e5e83af9f8f8ae/mediawiki/Specifications/OpenSearch/Extensions/Suggestions/1.1/Draft%201.wiki).

Picture of Firefox showing Algolia Query Suggestions from the URL bar with OpenSearch Suggestions.
## Usage
### Query parameters
- [`appId`](https://www.algolia.com/api-keys/)
- [`apiKey`](https://www.algolia.com/api-keys/)
- [`indexName`](https://www.algolia.com/explorer/)
- [`query`](https://www.algolia.com/doc/api-reference/api-parameters/query/)
- ...any [Algolia Search Parameters](https://www.algolia.com/doc/api-reference/search-api-parameters/)
###### Example
```
https://your-website.com/.netlify/functions/suggestions?query=iphone&appId=appId&apiKey=apiKey&indexName=indexName&hitsPerPage=3
```
### Returns
```json
["iphone",["iphone","iphone 6s","iphone gray"]]
```
### Add OpenSearch to your website
```xml
```
###### `opensearch.xml`
```html
```
###### `index.html`
## Resources
- [OpenSearch Description Format](https://developer.mozilla.org/en-US/docs/Web/OpenSearch)
- [OpenSearch Suggestions](https://developer.mozilla.org/en-US/docs/Archive/Add-ons/Supporting_search_suggestions_in_search_plugins)
- [OpenSearch Specs](https://github.com/dewitt/opensearch/blob/c9ed38a524c53b61d582634b28e5e83af9f8f8ae/opensearch-1-1-draft-6.md)
## License
[MIT](LICENSE)