People: Improve search on overview page #22
This commit is contained in:
parent
8b84022da9
commit
caa22742aa
|
@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user