mirror of
https://github.com/immich-app/immich.git
synced 2025-01-25 17:15:28 +02:00
fix(server): add more conditions to smart search (#5806)
* add more asset conditions * udpate sql
This commit is contained in:
parent
6e7b3d6f24
commit
b520955d0e
@ -56,6 +56,9 @@ export class SmartInfoRepository implements ISmartInfoRepository {
|
|||||||
.createQueryBuilder(AssetEntity, 'a')
|
.createQueryBuilder(AssetEntity, 'a')
|
||||||
.innerJoin('a.smartSearch', 's')
|
.innerJoin('a.smartSearch', 's')
|
||||||
.where('a.ownerId = :ownerId')
|
.where('a.ownerId = :ownerId')
|
||||||
|
.andWhere('a.isVisible = true')
|
||||||
|
.andWhere('a.isArchived = false')
|
||||||
|
.andWhere('a.fileCreatedAt < NOW()')
|
||||||
.leftJoinAndSelect('a.exifInfo', 'e')
|
.leftJoinAndSelect('a.exifInfo', 'e')
|
||||||
.orderBy('s.embedding <=> :embedding')
|
.orderBy('s.embedding <=> :embedding')
|
||||||
.setParameters({ ownerId, embedding: asVector(embedding) })
|
.setParameters({ ownerId, embedding: asVector(embedding) })
|
||||||
|
@ -66,7 +66,12 @@ FROM
|
|||||||
INNER JOIN "smart_search" "s" ON "s"."assetId" = "a"."id"
|
INNER JOIN "smart_search" "s" ON "s"."assetId" = "a"."id"
|
||||||
LEFT JOIN "exif" "e" ON "e"."assetId" = "a"."id"
|
LEFT JOIN "exif" "e" ON "e"."assetId" = "a"."id"
|
||||||
WHERE
|
WHERE
|
||||||
("a"."ownerId" = $1)
|
(
|
||||||
|
"a"."ownerId" = $1
|
||||||
|
AND "a"."isVisible" = true
|
||||||
|
AND "a"."isArchived" = false
|
||||||
|
AND "a"."fileCreatedAt" < NOW()
|
||||||
|
)
|
||||||
AND ("a"."deletedAt" IS NULL)
|
AND ("a"."deletedAt" IS NULL)
|
||||||
ORDER BY
|
ORDER BY
|
||||||
"s"."embedding" <= > $2 ASC
|
"s"."embedding" <= > $2 ASC
|
||||||
|
Loading…
x
Reference in New Issue
Block a user