Sha256: a2c611d5ebd0d3196454ee4c50027c90e57d02028f19259095a2ecd6347d7468
Contents?: true
Size: 1.05 KB
Versions: 53
Compression:
Stored size: 1.05 KB
Contents
# frozen_string_literal: true # The Searchable module can be included onto classes that need to initialize a SearchService. # There are three dependencies you must provide on the including class. Typically these # would be provided by Blacklight::Controller # 1. search_state # 2. blacklight_config # 3. search_service_class # # Additionally, the including class may override the search_service_context method to provide # further context to the SearchService. For example you could override this to provide the # currently signed in user. module Blacklight::Searchable # @return [Blacklight::SearchService] def search_service search_service_class.new(config: blacklight_config, search_state: search_state, user_params: search_state.to_h, **search_service_context) end # @return [Hash] a hash of context information to pass through to the search service def search_service_context {} end # @return [Blacklight::SuggestSearch] def suggestions_service Blacklight::SuggestSearch.new(params, search_service.repository).suggestions end end
Version data entries
53 entries across 53 versions & 2 rubygems