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



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

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



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

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



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

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