models/repo: modify keyword search to include description for #4287 (#4548)

* Modified repository keyword search to include description for #4287

* Replacing Where with And for #4548
This commit is contained in:
Simon Dann 2017-06-06 11:23:42 +01:00 committed by 无闻
parent c0be055541
commit e9a2b72ddb

View File

@ -1646,7 +1646,7 @@ func SearchRepositoryByName(opts *SearchRepoOptions) (repos []*Repository, _ int
}
}
if len(opts.Keyword) > 0 {
sess.And("repo.lower_name LIKE ?", "%"+strings.ToLower(opts.Keyword)+"%")
sess.And("repo.lower_name LIKE ? OR repo.description LIKE ?", "%"+strings.ToLower(opts.Keyword)+"%", "%"+strings.ToLower(opts.Keyword)+"%")
}
if opts.OwnerID > 0 {
sess.And("repo.owner_id = ?", opts.OwnerID)