Last active
May 22, 2019 20:10
-
-
Save lenkan/13bea464d3621e340bebee731bc0e72f to your computer and use it in GitHub Desktop.
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
const algolia = require("algoliasearch") | |
const client = algolia(ALGOLIA_APPLICATIONID, ALGOLIA_APIKEY) | |
async function run() { | |
const source = client.initIndex("test-index-from") | |
const target = client.initIndex("test-index-to") | |
const task = await client.copyIndex(source.indexName, target.indexName) | |
await source.waitTask(task.taskID) | |
} | |
run().then(() => { | |
console.log("Finished") | |
process.exit(0) | |
}).catch(error => { | |
console.error(error) | |
process.exit(1) | |
}) |
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
{ | |
"name": "tmp", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"start": "node index.js", | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "", | |
"license": "ISC", | |
"dependencies": { | |
"algoliasearch": "^3.33.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment