From 94b8a6ad652c5e47dc865f8d853a48907dc11175 Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Mon, 20 Sep 2021 09:57:48 +0200 Subject: [PATCH] People: Improve search for names in photos #22 --- internal/search/photos.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/search/photos.go b/internal/search/photos.go index 4983437be..ca6a98331 100644 --- a/internal/search/photos.go +++ b/internal/search/photos.go @@ -237,7 +237,7 @@ func Photos(f form.PhotoSearch) (results PhotoResults, count int, err error) { entity.Marker{}.TableName()), strings.Split(subj, txt.Or)) } } else if f.Subjects != "" { - for _, where := range LikeAnyWord("s.subj_name", f.Subjects) { + for _, where := range LikeAllNames(Cols{"subj_name", "subj_alias"}, f.Subjects) { s = s.Where(fmt.Sprintf("photos.id IN (SELECT photo_id FROM files f JOIN %s m ON f.file_uid = m.file_uid AND m.marker_invalid = 0 JOIN %s s ON s.subj_uid = m.subj_uid WHERE (?))", entity.Marker{}.TableName(), entity.Subject{}.TableName()), gorm.Expr(where)) }