People: Improve search on overview page #22

This commit is contained in:
Michael Mayer 2021-09-19 17:48:48 +02:00
parent 8b84022da9
commit caa22742aa

View File

@ -55,9 +55,12 @@ func Subjects(f form.SubjectSearch) (results SubjectResults, err error) {
return results, nil
}
// Clip to reasonable size and normalize operators.
f.Query = txt.NormalizeQuery(f.Query)
if f.Query != "" {
for _, where := range LikeAnyWord("subj_name", f.Query) {
s = s.Where("(?)", gorm.Expr(where))
for _, where := range LikeAllNames(Cols{"subj_name", "subj_alias"}, f.Query) {
s = s.Where("?", gorm.Expr(where))
}
}