1
0
mirror of https://github.com/immich-app/immich.git synced 2024-12-25 10:43:13 +02:00

fix(server): Fix incorrect sorting with search (#6031)

The search results are not sorted by date causing confision.

Fixes #5916
This commit is contained in:
Emanuel Bennici 2024-01-04 21:47:09 +01:00 committed by GitHub
parent 4cf1e553d2
commit d1e16025cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View File

@ -828,6 +828,7 @@ export class AssetRepository implements IAssetRepository {
@@ PLAINTO_TSQUERY('english', :query)`,
{ query },
)
.addOrderBy('asset.fileCreatedAt', 'DESC')
.limit(numResults)
.getRawMany();

View File

@ -841,5 +841,7 @@ WHERE
) @@ PLAINTO_TSQUERY('english', $3)
)
AND ("asset"."deletedAt" IS NULL)
ORDER BY
"asset"."fileCreatedAt" DESC
LIMIT
250