Gives API access to all Algolia functionality, settings, advanced features, and ML/AI products including Recommend
Works in node and all browsers (including IE11+)
Supports dynamic modules (load only what you need)
Built with Typescript
All major module formats (ESM, CJS, UMD)
Background retry strategy to ensure uptime
Thin & minimal low-level HTTP client to interact with Algolia's API
Batching via iterators to optimize number of network calls
Zero downtime reindexing feature
Works in node and all browsers (including IE11+)
Built with TypeScript" down from "Features" to match the Autocomplete libraries
FIRST, INSTALL ALGOLIA JAVASCRIPT API CLIENT VIA THE NPM PACKAGE MANAGER: (IF NEEDED, GET A FREE ACCOUNT HERE)
npm install 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);
});