Sha256: f40f6ce18df1773e6e8308cc1778bb19e8951857ee1de8f455425393472aab81

Contents?: true

Size: 614 Bytes

Versions: 41

Compression:

Stored size: 614 Bytes

Contents

# frozen_string_literal: true

module Spotlight
  # ...
  module SearchHelper
    def search_service(user_params = respond_to?(:search_state, true) ? search_state.to_h : {})
      klass = respond_to?(:search_service_class) ? search_service_class : Blacklight::SearchService

      klass.new(config: blacklight_config, user_params: user_params, **search_service_context)
    end

    # @return [Hash] a hash of context information to pass through to the search service
    def search_service_context
      return {} unless respond_to?(:current_ability)

      { current_ability: current_ability }
    end
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
blacklight-spotlight-4.2.0 app/controllers/concerns/spotlight/search_helper.rb
blacklight-spotlight-4.1.2 app/controllers/concerns/spotlight/search_helper.rb
blacklight-spotlight-4.1.1 app/controllers/concerns/spotlight/search_helper.rb
blacklight-spotlight-4.1.0 app/controllers/concerns/spotlight/search_helper.rb
blacklight-spotlight-4.0.3 app/controllers/concerns/spotlight/search_helper.rb
blacklight-spotlight-4.0.2 app/controllers/concerns/spotlight/search_helper.rb
blacklight-spotlight-4.0.1 app/controllers/concerns/spotlight/search_helper.rb
blacklight-spotlight-4.0.0 app/controllers/concerns/spotlight/search_helper.rb
blacklight-spotlight-3.6.0.beta10 app/controllers/concerns/spotlight/search_helper.rb
blacklight-spotlight-3.6.0.beta9 app/controllers/concerns/spotlight/search_helper.rb
blacklight-spotlight-3.6.0.beta8 app/controllers/concerns/spotlight/search_helper.rb
blacklight-spotlight-3.5.0.4 app/controllers/concerns/spotlight/search_helper.rb
blacklight-spotlight-3.6.0.beta7 app/controllers/concerns/spotlight/search_helper.rb
blacklight-spotlight-3.5.0.3 app/controllers/concerns/spotlight/search_helper.rb
blacklight-spotlight-3.6.0.beta6 app/controllers/concerns/spotlight/search_helper.rb
blacklight-spotlight-3.6.0.beta5 app/controllers/concerns/spotlight/search_helper.rb
blacklight-spotlight-3.6.0.beta4 app/controllers/concerns/spotlight/search_helper.rb
blacklight-spotlight-3.6.0.beta3 app/controllers/concerns/spotlight/search_helper.rb
blacklight-spotlight-3.6.0.beta1 app/controllers/concerns/spotlight/search_helper.rb
blacklight-spotlight-3.5.0.2 app/controllers/concerns/spotlight/search_helper.rb