fix(server): fix metadata search not working (#5800)

* don't require ml

* update e2e

* fixes

* fix e2e

* add additional conditions

* select all exif columns

* more fixes

* update sql
This commit is contained in:
Mert
2023-12-17 21:16:08 -05:00
committed by GitHub
parent c45e8cc170
commit 6e7b3d6f24
4 changed files with 80 additions and 40 deletions

View File

@@ -668,3 +668,30 @@ WHERE
AND ("asset"."deletedAt" IS NULL)
LIMIT
12
-- AssetRepository.searchMetadata
SELECT
asset.*,
e.*,
COALESCE("si"."tags", array[]::text []) AS "tags",
COALESCE("si"."objects", array[]::text []) AS "objects"
FROM
"assets" "asset"
INNER JOIN "exif" "e" ON asset."id" = e."assetId"
LEFT JOIN "smart_info" "si" ON si."assetId" = asset."id"
WHERE
(
"asset"."isVisible" = true
AND "asset"."fileCreatedAt" < NOW()
AND "asset"."ownerId" IN ($1)
AND "asset"."isArchived" = $2
AND (
e."exifTextSearchableColumn" || COALESCE(
si."smartInfoTextSearchableColumn",
to_tsvector('english', '')
)
) @@ PLAINTO_TSQUERY('english', $3)
)
AND ("asset"."deletedAt" IS NULL)
LIMIT
250