mirror of
https://github.com/immich-app/immich.git
synced 2024-12-28 22:51:59 +00:00
fix(server): face search results not always sorted (#7839)
* order by * update sql
This commit is contained in:
parent
4027cba4eb
commit
8dc62bd29a
2 changed files with 3 additions and 0 deletions
|
@ -188,6 +188,7 @@ export class SearchRepository implements ISearchRepository {
|
|||
.addCommonTableExpression(cte, 'cte')
|
||||
.from('cte', 'res')
|
||||
.where('res.distance <= :maxDistance', { maxDistance })
|
||||
.orderBy('res.distance')
|
||||
.getRawMany();
|
||||
});
|
||||
return results.map((row) => ({
|
||||
|
|
|
@ -229,6 +229,8 @@ FROM
|
|||
"cte" "res"
|
||||
WHERE
|
||||
res.distance <= $3
|
||||
ORDER BY
|
||||
res.distance ASC
|
||||
COMMIT
|
||||
|
||||
-- SearchRepository.searchPlaces
|
||||
|
|
Loading…
Reference in a new issue