Skip to content

Commit

Permalink
More debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-tteixeira authored Jan 19, 2024
1 parent 2d95b08 commit 40f6a7d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scripts/build-search-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,25 +170,33 @@ function getAllFilesInDirectory(articleDirectory, files) {
process.env.ALGOLIA_SECRET,
);

console.log("initIndex")

const index = client.initIndex("documentation");
const tmp_index = client.initIndex("documentation_tmp");

console.log("copyIndex", index.indexName, tmp_index,indexName)

client
.copyIndex(index.indexName, tmp_index.indexName, [
"settings",
"synonyms",
"rules",
])
.then(({ taskID }) => {
console.log("then 1")
tmp_index.waitTask(taskID);
})
.then(() => {
console.log("then 2")
return tmp_index.addObjects(to_index);
})
.then(({ taskID }) => {
console.log("then 3")
tmp_index.waitTask(taskID);
})
.then(() => {
console.log("then 4")
client.moveIndex(tmp_index.indexName, index.indexName);
console.log("... updating index");
})
Expand Down

0 comments on commit 40f6a7d

Please sign in to comment.