Sha256: a8dd29ec902ac359687ca056d73804bfccc36a1f5aea44bb981dd83a7b7da141

Contents?: true

Size: 1.06 KB

Versions: 53

Compression:

Stored size: 1.06 KB

Contents

# frozen_string_literal: true
module Blacklight
  class Configuration::SearchField < Blacklight::Configuration::Field
    # @!attribute include_in_simple_select
    # @!attribute qt
    # @!attribute query_builder
    #   @return [nil, #call] a Proc (or other object responding to #call) that receives as parameters: 1) the search builder, 2) this search field,
    #     and 3) the solr_parameters hash.  The Proc returns a string suitable for e.g. Solr's q parameter, or a 2-element array of the
    #     string and a hash of additional parameters to include with the query (i.e. for referenced subqueries); note that
    #     implementations are responsible for ensuring the additional parameter keys are unique.

    def normalize! blacklight_config = nil
      self.if = include_in_simple_select if self.if.nil?

      super
      self.qt ||= blacklight_config.default_solr_params[:qt] if blacklight_config && blacklight_config.default_solr_params

      self
    end

    def validate!
      raise ArgumentError, "Must supply a search field key" if key.nil?
    end
  end
end

Version data entries

53 entries across 53 versions & 2 rubygems

Version Path
blacklight-7.40.0 lib/blacklight/configuration/search_field.rb
blacklight-7.39.0 lib/blacklight/configuration/search_field.rb
blacklight-7.38.0 lib/blacklight/configuration/search_field.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/blacklight-7.37.0/lib/blacklight/configuration/search_field.rb
blacklight-7.37.0 lib/blacklight/configuration/search_field.rb
blacklight-7.36.2 lib/blacklight/configuration/search_field.rb
blacklight-7.36.1 lib/blacklight/configuration/search_field.rb
blacklight-7.36.0 lib/blacklight/configuration/search_field.rb
blacklight-7.35.0 lib/blacklight/configuration/search_field.rb
blacklight-7.34.0 lib/blacklight/configuration/search_field.rb
blacklight-7.33.1 lib/blacklight/configuration/search_field.rb
blacklight-7.33.0 lib/blacklight/configuration/search_field.rb
blacklight-7.32.0 lib/blacklight/configuration/search_field.rb
blacklight-7.31.0 lib/blacklight/configuration/search_field.rb
blacklight-7.30.0 lib/blacklight/configuration/search_field.rb
blacklight-7.29.0 lib/blacklight/configuration/search_field.rb
blacklight-7.28.0 lib/blacklight/configuration/search_field.rb
blacklight-7.27.1 lib/blacklight/configuration/search_field.rb
blacklight-7.27.0 lib/blacklight/configuration/search_field.rb
blacklight-7.26.1 lib/blacklight/configuration/search_field.rb