mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	feat(repo): support search repository by topic name (#4505)
* feat(repo): support search repository by topic name
This commit is contained in:
		@@ -122,6 +122,7 @@ func RenderRepoSearch(ctx *context.Context, opts *RepoSearchOptions) {
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	keyword := strings.Trim(ctx.Query("q"), " ")
 | 
			
		||||
	topicOnly := ctx.QueryBool("topic")
 | 
			
		||||
 | 
			
		||||
	repos, count, err = models.SearchRepositoryByName(&models.SearchRepoOptions{
 | 
			
		||||
		Page:      page,
 | 
			
		||||
@@ -131,6 +132,7 @@ func RenderRepoSearch(ctx *context.Context, opts *RepoSearchOptions) {
 | 
			
		||||
		Keyword:   keyword,
 | 
			
		||||
		OwnerID:   opts.OwnerID,
 | 
			
		||||
		AllPublic: true,
 | 
			
		||||
		TopicOnly: topicOnly,
 | 
			
		||||
	})
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		ctx.ServerError("SearchRepositoryByName", err)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user