From 79a8ab71efc526de88dee89435d91c0a3f8e398b Mon Sep 17 00:00:00 2001 From: Mert <101130780+mertalev@users.noreply.github.com> Date: Wed, 19 Jun 2024 17:25:02 -0400 Subject: [PATCH] fix(server): reindex after changing to a model with a different dimension size (#10496) reindex after truncating --- server/src/repositories/search.repository.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/server/src/repositories/search.repository.ts b/server/src/repositories/search.repository.ts index 439ccd099c..2637fffabe 100644 --- a/server/src/repositories/search.repository.ts +++ b/server/src/repositories/search.repository.ts @@ -315,6 +315,7 @@ export class SearchRepository implements ISearchRepository { await this.smartSearchRepository.manager.transaction(async (manager) => { await manager.clear(SmartSearchEntity); await manager.query(`ALTER TABLE smart_search ALTER COLUMN embedding SET DATA TYPE vector(${dimSize})`); + await manager.query(`REINDEX INDEX clip_index`); }); this.logger.log(`Successfully updated database CLIP dimension size from ${curDimSize} to ${dimSize}.`);