mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
feat(server)!: search via typesense (#1778)
* build: add typesense to docker * feat(server): typesense search * feat(web): search * fix(web): show api error response message * chore: search tests * chore: regenerate open api * fix: disable typesense on e2e * fix: number properties for open api (dart) * fix: e2e test * fix: change lat/lng from floats to typesense geopoint * dev: Add smartInfo relation to findAssetById to be able to query against it --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
@@ -1,12 +1,15 @@
|
||||
import {
|
||||
AssetService,
|
||||
IAlbumJob,
|
||||
IAssetJob,
|
||||
IAssetUploadedJob,
|
||||
IDeleteFilesJob,
|
||||
IDeleteJob,
|
||||
IUserDeletionJob,
|
||||
JobName,
|
||||
MediaService,
|
||||
QueueName,
|
||||
SearchService,
|
||||
SmartInfoService,
|
||||
StorageService,
|
||||
StorageTemplateService,
|
||||
@@ -61,6 +64,41 @@ export class MachineLearningProcessor {
|
||||
}
|
||||
}
|
||||
|
||||
@Processor(QueueName.SEARCH)
|
||||
export class SearchIndexProcessor {
|
||||
constructor(private searchService: SearchService) {}
|
||||
|
||||
@Process(JobName.SEARCH_INDEX_ALBUMS)
|
||||
async onIndexAlbums() {
|
||||
await this.searchService.handleIndexAlbums();
|
||||
}
|
||||
|
||||
@Process(JobName.SEARCH_INDEX_ASSETS)
|
||||
async onIndexAssets() {
|
||||
await this.searchService.handleIndexAssets();
|
||||
}
|
||||
|
||||
@Process(JobName.SEARCH_INDEX_ALBUM)
|
||||
async onIndexAlbum(job: Job<IAlbumJob>) {
|
||||
await this.searchService.handleIndexAlbum(job.data);
|
||||
}
|
||||
|
||||
@Process(JobName.SEARCH_INDEX_ASSET)
|
||||
async onIndexAsset(job: Job<IAssetJob>) {
|
||||
await this.searchService.handleIndexAsset(job.data);
|
||||
}
|
||||
|
||||
@Process(JobName.SEARCH_REMOVE_ALBUM)
|
||||
async onRemoveAlbum(job: Job<IDeleteJob>) {
|
||||
await this.searchService.handleRemoveAlbum(job.data);
|
||||
}
|
||||
|
||||
@Process(JobName.SEARCH_REMOVE_ASSET)
|
||||
async onRemoveAsset(job: Job<IDeleteJob>) {
|
||||
await this.searchService.handleRemoveAsset(job.data);
|
||||
}
|
||||
}
|
||||
|
||||
@Processor(QueueName.STORAGE_TEMPLATE_MIGRATION)
|
||||
export class StorageTemplateMigrationProcessor {
|
||||
constructor(private storageTemplateService: StorageTemplateService) {}
|
||||
|
||||
Reference in New Issue
Block a user