mirror of
https://github.com/immich-app/immich.git
synced 2025-02-11 01:18:24 -05:00
chore(server): simplify search face query and better clustering (#5573)
* chore(server): simplify search face query and better clustering * update sql * Use correct syntax for utilizing the index * Update sql
This commit is contained in:
parent
2234394aa6
commit
f206cb9403
2 changed files with 2 additions and 2 deletions
|
@ -88,7 +88,7 @@ export class SmartInfoRepository implements ISmartInfoRepository {
|
|||
.select('1 + (faces.embedding <=> :embedding)', 'distance')
|
||||
.innerJoin('faces.asset', 'asset')
|
||||
.where('asset.ownerId = :ownerId')
|
||||
.orderBy(`faces.embedding <=> :embedding`)
|
||||
.orderBy('1 + (faces.embedding <=> :embedding)')
|
||||
.setParameters({ ownerId, embedding: asVector(embedding) })
|
||||
.limit(numResults);
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ WITH
|
|||
WHERE
|
||||
"asset"."ownerId" = $2
|
||||
ORDER BY
|
||||
"faces"."embedding" <= > $3 ASC
|
||||
1 + ("faces"."embedding" <= > $3) ASC
|
||||
LIMIT
|
||||
100
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue