Sha256: af17a1770e1c5b9c9740e8d1591811733e165c223f14798534914f0ce6618719

Contents?: true

Size: 620 Bytes

Versions: 5

Compression:

Stored size: 620 Bytes

Contents

module IiifPrint
  # add highlighting on _stored_ full text field if this is a keyword search
  # can be added to default_processor_chain in a SearchBuilder class
  module HighlightSearchParams
    # add highlights on full text field, if there is a keyword query
    def highlight_search_params(solr_parameters = {})
      return unless solr_parameters[:q] || solr_parameters[:all_fields]
      solr_parameters[:hl] = true
      solr_parameters[:'hl.fl'] = '*'
      solr_parameters[:'hl.fragsize'] = 100
      solr_parameters[:'hl.snippets'] = 5
      solr_parameters[:'hl.requiredFieldMatch'] = true
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
iiif_print-3.0.1 app/search_builders/concerns/iiif_print/highlight_search_params.rb
iiif_print-3.0.0 app/search_builders/concerns/iiif_print/highlight_search_params.rb
iiif_print-2.0.1 app/search_builders/concerns/iiif_print/highlight_search_params.rb
iiif_print-2.0.0 app/search_builders/concerns/iiif_print/highlight_search_params.rb
iiif_print-1.1.0 app/search_builders/concerns/iiif_print/highlight_search_params.rb