Meteor package to handle the blazing fast Algolia search engine (working on client and server).
var client = AlgoliaSearch(<algolia_application_id>, <algolia_private_id>);
var index = client.initIndex(<algolia_index_name>);
// array contains the data you want to save in the index
var array = [ { objectID: 1, text: 'Hello' }, { objectID: 2, text: 'World' } ];
index.saveObjects(array, function (error, content) {
if (error) console.error('Error:', error);
else console.log('Content:', content);
});
var client = AlgoliaSearch(<algolia_application_id>, <algolia_public_id>);
var index = client.initIndex(<algolia_index_name>);
// search 'hello' in the index
index.search('hello', function (error, content) {
if (error) console.error('Error:', error);
else console.log('Content:', content);
});
There's a working example in the example
directory.
- cd example
- meteor
Check the source code.
Read the official Algolia doc for the available functions and options.
- Moved to algolia 3.9.1
- The global object is now called AlgoliaSearch both on client and server
- Moved to algolia v3+ check the migration guide
- Moved to algolia 3.7.8
- Add a working client and server example (cd example; meteor)