Sha256: d9b1eb330c6544801ed4e6932d5bf5049ee03fcecf75a6daedca2209d157eeaf

Contents?: true

Size: 710 Bytes

Versions: 6

Compression:

Stored size: 710 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::Indexer(:core_metadata)
    include Hyrax::Indexer(:basic_metadata)

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
hyrax-3.1.0 app/indexers/hyrax/pcdm_collection_indexer.rb
hyrax-3.0.2 app/indexers/hyrax/pcdm_collection_indexer.rb
hyrax-3.0.1 app/indexers/hyrax/pcdm_collection_indexer.rb
hyrax-3.0.0 app/indexers/hyrax/pcdm_collection_indexer.rb
hyrax-3.0.0.pre.rc4 app/indexers/hyrax/pcdm_collection_indexer.rb
hyrax-3.0.0.pre.rc3 app/indexers/hyrax/pcdm_collection_indexer.rb