Class: Hyrax::PcdmCollectionIndexer

Inherits:
ValkyrieIndexer show all
Includes:
PermissionIndexer, ResourceIndexer, VisibilityIndexer
Defined in:
app/indexers/hyrax/pcdm_collection_indexer.rb

Overview

Indexes properties common to PCDM Collections

Direct Known Subclasses

ValkyrieCollectionIndexer

Instance Attribute Summary

Attributes inherited from ValkyrieIndexer

#resource

Instance Method Summary collapse

Methods inherited from ValkyrieIndexer

for, #generate_solr_document, #initialize

Constructor Details

This class inherits a constructor from Hyrax::ValkyrieIndexer

Instance Method Details

#to_solrObject


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

def to_solr
  super.tap do |index_document|
    index_document[Hyrax.config.collection_type_index_field.to_sym] = Array(resource.try(:collection_type_gid)&.to_s)
    index_document[:generic_type_sim] = ['Collection']
    index_document[:thumbnail_path_ss] = Hyrax::CollectionThumbnailPathService.call(resource)
  end
end