diff --git a/server/src/queries/search.repository.sql b/server/src/queries/search.repository.sql index 987828a860..e058fc685c 100644 --- a/server/src/queries/search.repository.sql +++ b/server/src/queries/search.repository.sql @@ -405,3 +405,5 @@ FROM "assets" "asset" INNER JOIN "exif" "exif" ON "exif"."assetId" = "asset"."id" INNER JOIN cte ON asset.id = cte."assetId" +ORDER BY + exif.city diff --git a/server/src/repositories/search.repository.ts b/server/src/repositories/search.repository.ts index 2637fffabe..a4c7edab91 100644 --- a/server/src/repositories/search.repository.ts +++ b/server/src/repositories/search.repository.ts @@ -52,7 +52,7 @@ export class SearchRepository implements ISearchRepository { .innerJoinAndSelect('asset.exifInfo', 'exif') .withDeleted() .getQuery() + - ' INNER JOIN cte ON asset.id = cte."assetId"'; + ' INNER JOIN cte ON asset.id = cte."assetId" ORDER BY exif.city'; } async init(modelName: string): Promise {