Class: IiifPrint::CatalogSearchBuilder

Inherits:
Hyrax::CatalogSearchBuilder
  • Object
show all
Includes:
AllinsonFlexFields, ExcludeModels, HighlightSearchParams
Defined in:
lib/iiif_print/catalog_search_builder.rb

Overview

This class extends the base Hyrax::CatalogSearchBuilder by:

  • supporting highlighting of snippets in results

  • excluding models from search result; with complex works you might want to skip some of those works.

Instance Method Summary collapse

Methods included from AllinsonFlexFields

#include_allinson_flex_fields

Methods included from ExcludeModels

#exclude_models

Methods included from HighlightSearchParams

#highlight_search_params

Instance Method Details

#show_parents_only(solr_parameters) ⇒ Object

rubocop:enable Naming/PredicateName



26
27
28
29
30
31
32
33
# File 'lib/iiif_print/catalog_search_builder.rb', line 26

def show_parents_only(solr_parameters)
  query = if blacklight_params["include_child_works"] == 'true'
            IiifPrint.solr_construct_query(is_child_bsi: 'true')
          else
            IiifPrint.solr_construct_query(is_child_bsi: nil)
          end
  solr_parameters[:fq] += [query]
end