cleanup: logs for algolia

This commit is contained in:
Vyacheslav Matyukhin 2022-03-30 20:14:37 +03:00
parent 64d612a572
commit 6dfbe0c05e
No known key found for this signature in database
GPG Key ID: 3D2A774C5489F96C

View File

@ -6,7 +6,6 @@ import { mergeEverythingInner } from "../flow/mergeEverything";
let cookie = process.env.ALGOLIA_MASTER_API_KEY; let cookie = process.env.ALGOLIA_MASTER_API_KEY;
const algoliaAppId = process.env.NEXT_PUBLIC_ALGOLIA_APP_ID; const algoliaAppId = process.env.NEXT_PUBLIC_ALGOLIA_APP_ID;
const client = algoliasearch(algoliaAppId, cookie); const client = algoliasearch(algoliaAppId, cookie);
console.log(`Initializing algolia index for ${algoliaAppId}`);
const index = client.initIndex("metaforecast"); const index = client.initIndex("metaforecast");
export async function rebuildAlgoliaDatabaseTheHardWay() { export async function rebuildAlgoliaDatabaseTheHardWay() {
@ -54,8 +53,6 @@ export async function rebuildAlgoliaDatabaseTheEasyWay() {
})); }));
// this is necessary to filter by missing attributes https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/how-to/filter-by-null-or-missing-attributes/ // this is necessary to filter by missing attributes https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/how-to/filter-by-null-or-missing-attributes/
console.log(index.appId, index.indexName);
if (index.exists()) { if (index.exists()) {
console.log("Index exists"); console.log("Index exists");
await index.replaceAllObjects(records, { safe: true }); await index.replaceAllObjects(records, { safe: true });