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)) }