Skip to content

Package to handle Algolia API (client and server)

License

Notifications You must be signed in to change notification settings

officeabg/meteor-algolia

 
 

Repository files navigation

meteor-algolia

Meteor package to handle the blazing fast Algolia search engine (working on client and server).

Example

Server side

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);
});

Client side

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);
});

Meteor example app

There's a working example in the example directory.

  • cd example
  • meteor

Check the source code.

Documentation

Read the official Algolia doc for the available functions and options.

Changelog

  • 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)

About

Package to handle Algolia API (client and server)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 88.0%
  • HTML 12.0%