|
|
@ -248,7 +248,11 @@ func SearchRepositoryByName(opts *SearchRepoOptions) (RepositoryList, int64, err |
|
|
|
// separate keyword
|
|
|
|
// separate keyword
|
|
|
|
var subQueryCond = builder.NewCond() |
|
|
|
var subQueryCond = builder.NewCond() |
|
|
|
for _, v := range strings.Split(opts.Keyword, ",") { |
|
|
|
for _, v := range strings.Split(opts.Keyword, ",") { |
|
|
|
subQueryCond = subQueryCond.Or(builder.Like{"topic.name", strings.ToLower(v)}) |
|
|
|
if opts.TopicOnly { |
|
|
|
|
|
|
|
subQueryCond = subQueryCond.Or(builder.Eq{"topic.name": strings.ToLower(v)}) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
subQueryCond = subQueryCond.Or(builder.Like{"topic.name", strings.ToLower(v)}) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
subQuery := builder.Select("repo_topic.repo_id").From("repo_topic"). |
|
|
|
subQuery := builder.Select("repo_topic.repo_id").From("repo_topic"). |
|
|
|
Join("INNER", "topic", "topic.id = repo_topic.topic_id"). |
|
|
|
Join("INNER", "topic", "topic.id = repo_topic.topic_id"). |
|
|
|