Sha256: ddb7696cd9d3a1e5bbf7bdb192dcd22d867222464374c2d96c3b0e2d12b276b0

Contents?: true

Size: 867 Bytes

Versions: 25

Compression:

Stored size: 867 Bytes

Contents

# frozen_string_literal: true
module Hyrax
  class CollectionIndexer < Hydra::PCDM::CollectionIndexer
    include Hyrax::IndexesThumbnails

    STORED_LONG = ActiveFedora::Indexing::Descriptor.new(:long, :stored)

    self.thumbnail_path_service = Hyrax::CollectionThumbnailPathService

    # @yield [Hash] calls the yielded block with the solr document
    # @return [Hash] the solr document WITH all changes
    def generate_solr_document
      super.tap do |solr_doc|
        # Makes Collections show under the "Collections" tab
        solr_doc['generic_type_sim'] = ["Collection"]
        solr_doc['visibility_ssi'] = object.visibility

        object.in_collections.each do |col|
          (solr_doc['member_of_collection_ids_ssim'] ||= []) << col.id
          (solr_doc['member_of_collections_ssim'] ||= []) << col.to_s
        end
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
hyrax-5.0.1 app/indexers/hyrax/collection_indexer.rb
hyrax-5.0.0 app/indexers/hyrax/collection_indexer.rb
hyrax-5.0.0.rc3 app/indexers/hyrax/collection_indexer.rb
hyrax-5.0.0.rc2 app/indexers/hyrax/collection_indexer.rb
hyrax-5.0.0.rc1 app/indexers/hyrax/collection_indexer.rb
hyrax-3.6.0 app/indexers/hyrax/collection_indexer.rb
hyrax-4.0.0 app/indexers/hyrax/collection_indexer.rb
hyrax-4.0.0.rc3 app/indexers/hyrax/collection_indexer.rb
hyrax-4.0.0.rc2 app/indexers/hyrax/collection_indexer.rb
hyrax-4.0.0.rc1 app/indexers/hyrax/collection_indexer.rb
hyrax-3.5.0 app/indexers/hyrax/collection_indexer.rb
hyrax-4.0.0.beta2 app/indexers/hyrax/collection_indexer.rb
hyrax-3.4.2 app/indexers/hyrax/collection_indexer.rb
hyrax-4.0.0.beta1 app/indexers/hyrax/collection_indexer.rb
hyrax-3.4.1 app/indexers/hyrax/collection_indexer.rb
hyrax-3.4.0 app/indexers/hyrax/collection_indexer.rb
hyrax-3.3.0 app/indexers/hyrax/collection_indexer.rb
hyrax-3.2.0 app/indexers/hyrax/collection_indexer.rb
hyrax-3.1.0 app/indexers/hyrax/collection_indexer.rb
hyrax-3.0.2 app/indexers/hyrax/collection_indexer.rb