Package to handle Algolia API (client and server)
JavaScript HTML
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
algoliasearch-client-js @ 28a4b84
example
.gitignore
.gitmodules
LICENSE
README.md
client.js
package.js
server.js
update_package
versions.json

README.md

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)