diff --git a/models/issue.go b/models/issue.go index c0bafb54e..58eb229f2 100644 --- a/models/issue.go +++ b/models/issue.go @@ -1706,17 +1706,18 @@ func GetRepoIssueStats(repoID, uid int64, filterMode int, isPull bool) (numOpen func SearchIssueIDsByKeyword(kw string, repoIDs []int64, limit, start int) (int64, []int64, error) { var repoCond = builder.In("repo_id", repoIDs) var subQuery = builder.Select("id").From("issue").Where(repoCond) + kw = strings.ToUpper(kw) var cond = builder.And( repoCond, builder.Or( - builder.Like{"name", kw}, - builder.Like{"content", kw}, + builder.Like{"UPPER(name)", kw}, + builder.Like{"UPPER(content)", kw}, builder.In("id", builder.Select("issue_id"). From("comment"). Where(builder.And( builder.Eq{"type": CommentTypeComment}, builder.In("issue_id", subQuery), - builder.Like{"content", kw}, + builder.Like{"UPPER(content)", kw}, )), ), ),