Module: Hyrax::IndexesThumbnails

Extended by:
ActiveSupport::Concern
Included in:
AdminSetIndexer, CollectionIndexer, FileSetIndexer, WorkIndexer
Defined in:
app/services/hyrax/indexes_thumbnails.rb

Instance Method Summary collapse

Instance Method Details

#generate_solr_documentObject

Adds thumbnail indexing to the solr document



13
14
15
16
17
# File 'app/services/hyrax/indexes_thumbnails.rb', line 13

def generate_solr_document
  super.tap do |solr_doc|
    index_thumbnails(solr_doc)
  end
end

#index_thumbnails(solr_document) ⇒ Object

Write the thumbnail paths into the solr_document

Parameters:

  • solr_document (Hash)

    the solr document to add the field to



21
22
23
# File 'app/services/hyrax/indexes_thumbnails.rb', line 21

def index_thumbnails(solr_document)
  solr_document[thumbnail_field] = thumbnail_path
end

#thumbnail_pathObject

Returns the value for the thumbnail path to put into the solr document



26
27
28
# File 'app/services/hyrax/indexes_thumbnails.rb', line 26

def thumbnail_path
  self.class.thumbnail_path_service.call(object)
end