diff --git a/app/services/search/global_service.rb b/app/services/search/global_service.rb index 372d1bf712949862773a61815319ce4f002e8bac..8a1fce17ce7b4cc175100f63dd595721ed0ccf37 100644 --- a/app/services/search/global_service.rb +++ b/app/services/search/global_service.rb @@ -16,9 +16,7 @@ module Search projects = projects.where(namespace_id: group.id) if group project_ids = projects.pluck(:id) - projects = projects.search(query) - - result[:projects] = projects.limit(20) + result[:projects] = projects.search(query).limit(20) result[:merge_requests] = MergeRequest.in_projects(project_ids).search(query).order('updated_at DESC').limit(20) result[:issues] = Issue.where(project_id: project_ids).search(query).order('updated_at DESC').limit(20) result[:total_results] = %w(projects issues merge_requests).sum { |items| result[items.to_sym].size }