app/services/blacklight/search_service.rb in blacklight-7.0.1 vs app/services/blacklight/search_service.rb in blacklight-7.1.0.alpha
- old
+ new
@@ -1,16 +1,17 @@
# frozen_string_literal: true
# SearchService returns search results from the repository
module Blacklight
class SearchService
- def initialize(config:, user_params: {}, search_builder_class: config.search_builder_class)
+ def initialize(config:, user_params: {}, search_builder_class: config.search_builder_class, **context)
@blacklight_config = config
@user_params = user_params
@search_builder_class = search_builder_class
+ @context = context
end
- # The blacklight_config is accessed by the search_builder
- attr_reader :blacklight_config
+ # The blacklight_config + controller are accessed by the search_builder
+ attr_reader :blacklight_config, :context
def search_builder
search_builder_class.new(self)
end