mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Add search mode option to /api/repo/search (#2756)
* Add repo type option to /api/repo/search * Add tests and fix result of collaborative filter in specific condition * Fix/optimize search & tests * Improve integration tests * Fix lint errors * Fix unit tests * Change and improve internal implementation of repo search * Use NonexistentID * Make search api more general * Change mirror and fork search behaviour * Fix tests & typo in comment
This commit is contained in:
		@@ -108,14 +108,13 @@ func RenderRepoSearch(ctx *context.Context, opts *RepoSearchOptions) {
 | 
			
		||||
	keyword := strings.Trim(ctx.Query("q"), " ")
 | 
			
		||||
 | 
			
		||||
	repos, count, err = models.SearchRepositoryByName(&models.SearchRepoOptions{
 | 
			
		||||
		Page:        page,
 | 
			
		||||
		PageSize:    opts.PageSize,
 | 
			
		||||
		OrderBy:     orderBy,
 | 
			
		||||
		Private:     opts.Private,
 | 
			
		||||
		Keyword:     keyword,
 | 
			
		||||
		OwnerID:     opts.OwnerID,
 | 
			
		||||
		Collaborate: true,
 | 
			
		||||
		AllPublic:   true,
 | 
			
		||||
		Page:      page,
 | 
			
		||||
		PageSize:  opts.PageSize,
 | 
			
		||||
		OrderBy:   orderBy,
 | 
			
		||||
		Private:   opts.Private,
 | 
			
		||||
		Keyword:   keyword,
 | 
			
		||||
		OwnerID:   opts.OwnerID,
 | 
			
		||||
		AllPublic: true,
 | 
			
		||||
	})
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		ctx.Handle(500, "SearchRepositoryByName", err)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user