fix: delete old docs index on force re-index (#1778)

This commit is contained in:
Priyash 2024-07-19 22:22:23 +05:30 • committed by GitHub
parent 6e8fc1247c
commit 0d632eabbf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -296,6 +296,12 @@ export class DocsService {
status: "indexing",
};
// Clear old index if re-indexing.
if (reIndex) {
console.log("Deleting old embeddings");
await this.delete(startUrl.toString());
}
await this.add(siteIndexingConfig.title, startUrl, chunks, embeddings);
this.docsIndexingQueue.delete(startUrl.toString());