Skip to content
Snippets Groups Projects
Commit 4c7e4c1d authored by Sean McGivern's avatar Sean McGivern Committed by 🤖 GitLab Bot 🤖
Browse files

Merge branch 'ce-12091-remove-elasticsearch-lite-project' into 'master'

Backport changes from 'Partially revert d9cb907c: "Avoid loading objects from DB in ES results"'

See merge request gitlab-org/gitlab-ce!29597

(cherry picked from commit 0a70ba17)

06440b12 Revert "Avoid loading objects from DB in ES results"
0a2c334c Restore some unrelated changes from d9cb907c
parent 879148ee
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -25,7 +25,6 @@ class SearchController < ApplicationController
@show_snippets = search_service.show_snippets?
@search_results = search_service.search_results
@search_objects = search_service.search_objects
@display_options = search_service.display_options
 
render_commits if @scope == 'commits'
eager_load_user_status if @scope == 'users'
Loading
Loading
Loading
Loading
@@ -72,8 +72,6 @@ class ProjectFeature < ApplicationRecord
default_value_for :wiki_access_level, value: ENABLED, allows_nil: false
default_value_for :repository_access_level, value: ENABLED, allows_nil: false
 
scope :for_project_id, -> (project) { where(project: project) }
def feature_available?(feature, user)
# This feature might not be behind a feature flag at all, so default to true
return false unless ::Feature.enabled?(feature, user, default_enabled: true)
Loading
Loading
Loading
Loading
@@ -52,10 +52,6 @@ class SearchService
@search_objects ||= search_results.objects(scope, params[:page])
end
 
def display_options
@display_options ||= search_results.display_options(scope)
end
private
 
def search_service
Loading
Loading
Loading
Loading
@@ -21,7 +21,7 @@
.search-results
- if @scope == 'projects'
.term
= render 'shared/projects/list', { projects: @search_objects, pipeline_status: false }.merge(@display_options)
= render 'shared/projects/list', projects: @search_objects, pipeline_status: false
- else
- locals = { projects: blob_projects(@search_objects) } if %w[blobs wiki_blobs].include?(@scope)
= render partial: "search/results/#{@scope.singularize}", collection: @search_objects, locals: locals
Loading
Loading
Loading
Loading
@@ -85,10 +85,6 @@ module Gitlab
UsersFinder.new(current_user, search: query).execute
end
 
def display_options(_scope)
{}
end
private
 
def projects
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment