Class: Hyrax::PcdmCollectionIndexer

Inherits:
ValkyrieIndexer show all
Includes:
PermissionIndexer, ResourceIndexer, ThumbnailIndexer, 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 included from ThumbnailIndexer

#index_thumbnails, #thumbnail_path

Methods inherited from ValkyrieIndexer

for, #generate_solr_document, #initialize

Constructor Details

This class inherits a constructor from Hyrax::ValkyrieIndexer

Instance Method Details

#to_solrObject


15
16
17
18
19
20
21
22
# File 'app/indexers/hyrax/pcdm_collection_indexer.rb', line 15

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[:depositor_ssim] = [resource.depositor]
    index_document[:depositor_tesim] = [resource.depositor]
  end
end