From e9a2b72ddb0a5d069e72aceabb36337e5b9e9dcd Mon Sep 17 00:00:00 2001 From: Simon Dann Date: Tue, 6 Jun 2017 11:23:42 +0100 Subject: [PATCH] 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 --- models/repo.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/repo.go b/models/repo.go index 873546411..4c70269e8 100644 --- a/models/repo.go +++ b/models/repo.go @@ -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)