Skip to content

Commit 0d632ea

Browse files
authored
fix: delete old docs index on force re-index (#1778)
1 parent 6e8fc12 commit 0d632ea

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

core/indexing/docs/DocsService.ts

+6
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,12 @@ export class DocsService {
296296
status: "indexing",
297297
};
298298

299+
// Clear old index if re-indexing.
300+
if (reIndex) {
301+
console.log("Deleting old embeddings");
302+
await this.delete(startUrl.toString());
303+
}
304+
299305
await this.add(siteIndexingConfig.title, startUrl, chunks, embeddings);
300306
this.docsIndexingQueue.delete(startUrl.toString());
301307

0 commit comments

Comments
 (0)