All Projects → chrisdmacrae → atomic-algolia

chrisdmacrae / atomic-algolia

Licence: other
An NPM package for running atomic updates to an Algolia indices

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to atomic-algolia

use-algolia
Dead-simple React hook to make Algolia search queries. Supports pagination out of the box.
Stars: ✭ 29 (-55.38%)
Mutual labels:  algolia, algoliasearch
What Hn Says Webext
Web Extension: Easily find Hacker News discussions about the page you're currently browsing.
Stars: ✭ 214 (+229.23%)
Mutual labels:  algolia
Algoliasearch Magento 2
Algolia Search integration for Magento 2 - compatible with versions from 2.3.x to 2.4.x
Stars: ✭ 131 (+101.54%)
Mutual labels:  algolia
Algoliasearch Client Swift
⚡️ A fully-featured and blazing-fast Swift API client to interact with Algolia.
Stars: ✭ 166 (+155.38%)
Mutual labels:  algolia
Docsearch
📘 The easiest way to add search to your documentation.
Stars: ✭ 2,266 (+3386.15%)
Mutual labels:  algolia
Dvc.org
🔗 DVC website and documentation
Stars: ✭ 171 (+163.08%)
Mutual labels:  algolia
Searchstone
🃏 Hearthstone's cards search engine built with algolia instantsearch.
Stars: ✭ 117 (+80%)
Mutual labels:  algolia
Instantsearch.js
⚡️ A JavaScript library for building performant and instant search experiences with Algolia.
Stars: ✭ 2,799 (+4206.15%)
Mutual labels:  algolia
Algoliasearch Netlify
Official Algolia Plugin for Netlify. Index your website to Algolia when deploying your project to Netlify with the Algolia Crawler
Stars: ✭ 208 (+220%)
Mutual labels:  algolia
Algoliasearch Magento
Algolia Search integration for Magento 1 - compatible with versions from 1.6.x to 1.9.x
Stars: ✭ 163 (+150.77%)
Mutual labels:  algolia
Combine Pagination
A JavaScript library for paginating data from multiple sources 🦑
Stars: ✭ 157 (+141.54%)
Mutual labels:  algolia
Algoliasearch Helper Js
Helper for implementing advanced search features with Algolia
Stars: ✭ 147 (+126.15%)
Mutual labels:  algolia
Atom Autocomplete Module Import
⚛️ Search & install npm packages from import/require statements.
Stars: ✭ 182 (+180%)
Mutual labels:  algolia
Algoliasearch Client Python
⚡️ A fully-featured and blazing-fast Python API client to interact with Algolia.
Stars: ✭ 138 (+112.31%)
Mutual labels:  algolia
Angular Instantsearch
⚡️Lightning-fast search for Angular apps, by Algolia
Stars: ✭ 219 (+236.92%)
Mutual labels:  algolia
Instantsearch Android
A library of widgets and helpers to build instant-search applications on Android.
Stars: ✭ 129 (+98.46%)
Mutual labels:  algolia
Gatsby Plugin Algolia
A plugin to push to Algolia based on graphQl queries
Stars: ✭ 154 (+136.92%)
Mutual labels:  algolia
Angular Search Experience
Algolia + Angular = 🔥🔥🔥
Stars: ✭ 167 (+156.92%)
Mutual labels:  algolia
Learn X By Doing Y
🛠️ Learn a technology X by doing a project - Search engine of project-based learning
Stars: ✭ 242 (+272.31%)
Mutual labels:  algolia
Docs
Repository of Twilio SendGrid's product documentation.
Stars: ✭ 221 (+240%)
Mutual labels:  algolia

Algolia Atomic

An NPM package for running atomic updates to Algolia indices

All Contributors npm

How it works

This package runs atomic updates to Algolia Indices. What does that mean?

Simply put, this package reads your local index, and updates the new or updated records, while removing deleted records.

It does this all at once, so your index is never out of sync with your content, and you use the smallest amount of operations possible.

(Stay on that free plan as long as you can!)

Installation

To install this script, you must have Node & NPM installed. Once installed, run the following command in your terminal:

npm install atomic-algolia

Usage

This package can be used in NPM "scripts" or in Javascript Files.

It reads an array of objects or local JSON file with an array of valid records. For example:

[
    {
        "objectID": "1",
        "title": "An example record"
    }
]

NPM Scripts

To use this package in your NPM scripts, add the command to your script in package.json.

Note, this package can only be used in NPM scripts to update a single index from a local JSON file. To update multiple indices or pass in a Javascript object, create your own script by following the instructions in Javascript Files

E.g:

...
"scripts": {
    "algolia": "atomic-algolia"
}
...

Lastly, run your NPM command. E.g:

ALGOLIA_APP_ID={{ YOUR_APP_ID}} ALGOLIA_ADMIN_KEY={{ YOUR_ADMIN_KEY }} ALGOLIA_INDEX_NAME={{ YOUR_INDEX_NAME }} ALGOLIA_INDEX_FILE={{ YOUR_FILE_PATH }} npm run algolia

Scripts

To use this package in your own local script, require it in your file. E.g:

Using with a local JSON file

var atomicalgolia = require("atomic-algolia")
var indexName = "example_index"
var indexPath = "./index.json"
var cb = function(error, result) {
    if (err) throw error

    console.log(result)
}

atomicalgolia(indexName, indexPath, cb)

Then call the script from your terminal as follows:

ALGOLIA_APP_ID={{ YOUR_APP_ID}} ALGOLIA_ADMIN_KEY={{ YOUR_ADMIN_KEY }} node YOUR_SCRIPT.js

Using with an Array of Objects

var atomicalgolia = require("atomic-algolia")
var indexName = "example_index"

var indexData = [
    {
        objectID: "1",
        title: "An example record"
    }
]

var cb = function(error, result) {
    if (error) throw error

    console.log(result)
}

atomicalgolia(indexName, indexData, cb)

Then call the script from your terminal as follows:

ALGOLIA_APP_ID={{ YOUR_APP_ID}} ALGOLIA_ADMIN_KEY={{ YOUR_ADMIN_KEY }} node YOUR_SCRIPT.js

Using a .env file

A .env file can be added to the root of your project with the required environment variables. This way, you don't have to specify them in package.json or when running the command.

Run the following command:

touch .env && open .env

Then paste in the following contents, and update the placeholder variable marked with braces {{ }}

ALGOLIA_APP_ID={{ YOUR_APP_ID }}
ALGOLIA_ADMIN_KEY={{ YOUR_ADMIN_KEY }}
ALGOLIA_INDEX_NAME={{ YOUR_INDEX_NAME }}
ALGOLIA_INDEX_FILE={{ YOUR_INDEX_FILE }}

ALGOLIA_APP_ID: the ID of the Algolia app instance that contains your index.

ALGOLIA_ADMIN_KEY: the adminstrative key for the Algolia app instance that contains your index.

ALGOLIA_INDEX_NAME: the name of the index you're updating.

ALGOLIA_INDEX_FILE: the relative path to your index file from the root of your project.

Contributors

Thanks goes to these wonderful people (emoji key):


chrisdmacrae

💬 💻 🎨 📖

Tim Carry

💬 💻 📖

This project follows the all-contributors specification. Contributions of any kind welcome!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].