djLint/docs/src/search/update-algolia-index.js
Christopher Pickering efec955de5
updated docs
2022-01-03 16:45:58 -06:00

11 lines
416 B
JavaScript

const algoliasearch = require("algoliasearch");
const objects = require("../../_site/search/all.json");
const client = algoliasearch('QFXNLHI6NP', process.env.ALGOLIA_SEARCH);
const index = client.initIndex('dev_atlas');
index.replaceAllObjects(objects, { autoGenerateObjectIDIfNotExist: true }).then(() => {
console.log("updated");
}).catch((error) => console.error("Failed to Algolia update index", error));