This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fs from 'fs'; | |
import algoliasearch from 'algoliasearch'; | |
const IDS_FILE = './query_results.csv'; | |
const indexName = ''; // The index we want | |
const client = algoliasearch('', ''); // The credentials | |
const index = client.initIndex(indexName); | |
const objectIds = fs.readFileSync(IDS_FILE, 'utf8').trim().split('\n').filter(x => /\d/.test(x)).map(x => x.replace(/"/g, '')); |