[go: nahoru, domu]

Skip to content

Commit

Permalink
fix(server): reindex after changing to a model with a different dimen…
Browse files Browse the repository at this point in the history
…sion size (immich-app#10496)

reindex after truncating
  • Loading branch information
mertalev committed Jun 19, 2024
1 parent 1191978 commit 79a8ab7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions server/src/repositories/search.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}.`);
Expand Down

0 comments on commit 79a8ab7

Please sign in to comment.