antv-l7/node_modules/algoliasearch
thinkinggis f7e5376b7d fix(fix css): fix css png 2019-11-22 18:04:14 +08:00
..
dist fix(fix css): fix css png 2019-11-22 18:04:14 +08:00
node_modules fix(fix css): fix css png 2019-11-22 18:04:14 +08:00
plugins fix(fix css): fix css png 2019-11-22 18:04:14 +08:00
src fix(fix css): fix css png 2019-11-22 18:04:14 +08:00
CHANGELOG.md fix(fix css): fix css png 2019-11-22 18:04:14 +08:00
LICENSE.txt fix(fix css): fix css png 2019-11-22 18:04:14 +08:00
README.md fix(fix css): fix css png 2019-11-22 18:04:14 +08:00
bower.json fix(fix css): fix css png 2019-11-22 18:04:14 +08:00
index.js fix(fix css): fix css png 2019-11-22 18:04:14 +08:00
lite.js fix(fix css): fix css png 2019-11-22 18:04:14 +08:00
package.json fix(fix css): fix css png 2019-11-22 18:04:14 +08:00
reactnative.js fix(fix css): fix css png 2019-11-22 18:04:14 +08:00

README.md

Algolia for JavaScript

The perfect starting point to integrate Algolia within your JavaScript project

Build Status NPM version NPM downloads jsDelivr Downloads License

DocumentationInstantSearchCommunity ForumStack OverflowReport a bugSupport

Features

  • Thin & minimal low-level HTTP client to interact with Algolia's API
  • Works both on the browser and node.js
  • UMD compatible, you can use it with any module loader
  • Contains type definitions: @types/algoliasearch

💡 Getting Started

First, install Algolia JavaScript API Client via the npm package manager:

npm install --save algoliasearch

Then, create objects on your index:

const algoliasearch = require('algoliasearch');

const client = algoliasearch('YourApplicationID', 'YourAdminAPIKey');
const index = client.initIndex('your_index_name');

const objects = [{
  objectID: 1,
  name: 'Foo'
}];

index
  .saveObjects(objects)
  .then(({ objectIDs }) => {
    console.log(objectIDs);
  })
  .catch(err => {
    console.log(err);
  });

Finally, let's actually search using the search method:

index
  .search('Fo')
  .then(({ hits }) => {
    console.log(hits);
  })
  .catch(err => {
    console.log(err);
  });

For full documentation, visit the online documentation.

📄 License

Algolia JavaScript API Client is an open-sourced software licensed under the MIT license.