|
|
|
@@ -200,8 +200,8 @@ const ( |
|
|
|
SearchOrderByForks SearchOrderBy = "num_forks ASC" |
|
|
|
SearchOrderByForksReverse SearchOrderBy = "num_forks DESC" |
|
|
|
SearchOrderByDownloadTimes SearchOrderBy = "download_times DESC" |
|
|
|
SearchOrderByHot SearchOrderBy = "(num_watches + num_stars + num_forks + clone_cnt) DESC" |
|
|
|
SearchOrderByActive SearchOrderBy = "(num_issues + num_pulls + num_commit) DESC" |
|
|
|
SearchOrderByHot SearchOrderBy = "(num_watches + num_stars + num_forks + clone_cnt) DESC" |
|
|
|
SearchOrderByActive SearchOrderBy = "(num_issues + num_pulls + num_commit) DESC" |
|
|
|
) |
|
|
|
|
|
|
|
// SearchRepositoryCondition creates a query condition according search repository options |
|
|
|
@@ -321,6 +321,7 @@ func SearchRepositoryCondition(opts *SearchRepoOptions) builder.Cond { |
|
|
|
var likes = builder.NewCond() |
|
|
|
for _, v := range strings.Split(opts.Keyword, ",") { |
|
|
|
likes = likes.Or(builder.Like{"lower_name", strings.ToLower(v)}) |
|
|
|
likes = likes.Or(builder.Like{"alias", strings.ToLower(v)}) |
|
|
|
if opts.IncludeDescription { |
|
|
|
likes = likes.Or(builder.Like{"LOWER(description)", strings.ToLower(v)}) |
|
|
|
} |
|
|
|
|