Module: Dbla::SearchBuilderBehavior

Included in:
SearchBuilder
Defined in:
lib/dbla/search_builder_behavior.rb

Instance Method Summary collapse

Instance Method Details

#facet_filtersObject



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/dbla/search_builder_behavior.rb', line 10

def facet_filters
  # :fq, map from :f.
  if ( blacklight_params[:f])
    f_request_params = blacklight_params[:f]

    f_request_params.each_pair do |facet_field, value_list|
      Array(value_list).each do |value|
        next if value.blank? # skip empty strings
        yield *[facet_field, value]
      end
    end
  end
end

#processed_parametersObject



3
4
5
6
7
8
9
# File 'lib/dbla/search_builder_behavior.rb', line 3

def processed_parameters
  request.tap do |request_parameters|
    if blacklight_params[:q] || blacklight_params[:f]
      request_parameters[:q] = blacklight_params.fetch(:q,'')
    end
  end
end