Module: IiifPrint::ExcludeModels

Extended by:
ActiveSupport::Concern
Included in:
CatalogSearchBuilder
Defined in:
app/search_builders/concerns/iiif_print/exclude_models.rb

Overview

hide Title, Container, and Issue objects if this is a keyword search can be added to default_processor_chain in a SearchBuilder class

Instance Method Summary collapse

Instance Method Details

#exclude_models(solr_parameters, config: IiifPrint.config) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'app/search_builders/concerns/iiif_print/exclude_models.rb', line 7

def exclude_models(solr_parameters, config: IiifPrint.config)
  return unless solr_parameters[:q] || solr_parameters[:all_fields]

  solr_parameters[:fq] ||= []
  key = config.excluded_model_name_solr_field_key
  config.excluded_model_name_solr_field_values.each do |value|
    solr_parameters[:fq] << "-#{key}:\"#{value}\""
  end
end