Module: Hyrax::ThumbnailIndexer

Extended by:
ActiveSupport::Concern
Included in:
PcdmCollectionIndexer, ValkyrieFileSetIndexer, ValkyrieWorkIndexer
Defined in:
app/indexers/hyrax/thumbnail_indexer.rb

Instance Method Summary collapse

Instance Method Details

#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/indexers/hyrax/thumbnail_indexer.rb', line 22

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

#thumbnail_pathObject

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


27
28
29
# File 'app/indexers/hyrax/thumbnail_indexer.rb', line 27

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

#to_solrObject

Adds thumbnail indexing to the solr document of a valkyrie resource


14
15
16
17
18
# File 'app/indexers/hyrax/thumbnail_indexer.rb', line 14

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