hapi-algolia-search
Hapi plugin wrapping the JS Algolia Search client
Algolia is a "Search Engine as a Service", with high performance, great docs, and API clients available for many languages. Check it out !
Table of Contents
Install
$ npm install hapi-algolia-search
Register
Manually
const HapiAlgoliaSearch = ; const plugin = register: HapiAlgoliaSearch options: appId: 'ABCDEFGHIJ' apiKey: 'LKHFDLSKHFLKSDFHLSKHFSLKFHLSKHDFLSKHDFLKHSDFL' indexPrefix: 'dev_' //optional indexes: Users: 'usersIndex' Products: 'productsIndex' clientOptions: timeout: 1000 ; server;
Via manifest
Configuration options
appId
(required) your Algolia API App IDapiKey
(required) your Algolia API Api keyindexes
(optional) you can specify indexes that will be automatically initialized and exposed by the pluginindexPrefix
(optional) a prefix you want to apply to all index names, i.e to reflect your current environment (https://www.algolia.com/doc/node#different-environments)clientOptions
(optional) see https://github.com/algolia/algoliasearch-client-js#client-options
Usage
In your route handler :
server
Questions and contributing
Any issues or questions (no matter how basic), open an issue. Please check if it's not an issue with the Algolia API first. Also, please take the initiative to include basic debugging information like operating system and relevant version details such as:
$ npm version #{ 'hapi-algolia-search': '1.0.0-alpha',# npm: '3.3.12', # ares: '1.10.1-DEV', # http_parser: '2.6.0', # icu: '56.1', # modules: '47', # node: '5.1.0', # openssl: '1.0.2d', # uv: '1.7.5', # v8: '4.6.85.31', # zlib: '1.2.8' }
Contributions are welcome. Your code should:
- follow the hapi.js coding conventions
If you're changing something non-trivial, you may want to submit an issue first.
License
MIT