Sha256: daa3f49d96e72c5bc75a8396a2c9bcbe9cf04d4f336348d0cdaa28ae2b2a49df

Contents?: true

Size: 797 Bytes

Versions: 2

Compression:

Stored size: 797 Bytes

Contents

# frozen_string_literal: true

module Hyrax
  ##
  # Indexes properties common to PCDM Collections
  class PcdmCollectionIndexer < Hyrax::ValkyrieIndexer
    include Hyrax::ResourceIndexer
    include Hyrax::PermissionIndexer
    include Hyrax::VisibilityIndexer
    include Hyrax::ThumbnailIndexer
    include Hyrax::Indexer(:core_metadata)

    self.thumbnail_path_service = CollectionThumbnailPathService

    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
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hyrax-3.4.2 app/indexers/hyrax/pcdm_collection_indexer.rb
hyrax-4.0.0.beta1 app/indexers/hyrax/pcdm_collection_indexer.rb