refactor: remove smart search entity (#17447)

refactor: smart search entity
This commit is contained in:
Jason Rasmussen
2025-04-08 09:56:45 -04:00
committed by GitHub
parent 2b131fe935
commit fdbe6d649f
10 changed files with 125 additions and 134 deletions

View File

@@ -475,6 +475,26 @@ export class AssetRepository {
return count as number;
}
@GenerateSql({ params: [DummyValue.UUID] })
getAssetForSearchDuplicatesJob(id: string) {
return this.db
.selectFrom('assets')
.where('assets.id', '=', asUuid(id))
.leftJoin('smart_search', 'assets.id', 'smart_search.assetId')
.select((eb) => [
'id',
'type',
'ownerId',
'duplicateId',
'stackId',
'isVisible',
'smart_search.embedding',
withFiles(eb, AssetFileType.PREVIEW),
])
.limit(1)
.executeTakeFirst();
}
@GenerateSql({ params: [DummyValue.UUID] })
getById(
id: string,