Sha256: 3abb1fef4d542ce4fc5f3a4d65497eaa72327e9006a9c62338bd672896c3ef29

Contents?: true

Size: 1.1 KB

Versions: 22

Compression:

Stored size: 1.1 KB

Contents

# frozen_string_literal: true
module Hyrax
  class WorkIndexer < ActiveFedora::IndexingService
    include Hyrax::IndexesThumbnails
    include Hyrax::IndexesWorkflow

    self.thumbnail_path_service = Hyrax::WorkThumbnailPathService
    def generate_solr_document
      super.tap do |solr_doc|
        solr_doc['member_ids_ssim'] = object.member_ids
        solr_doc['member_of_collections_ssim']    = object.member_of_collections.map(&:first_title)
        solr_doc['member_of_collection_ids_ssim'] = object.member_of_collections.map(&:id)
        solr_doc['generic_type_sim'] = ['Work']

        # This enables us to return a Work when we have a FileSet that matches
        # the search query.  While at the same time allowing us not to return Collections
        # when a work in the collection matches the query.
        solr_doc['file_set_ids_ssim'] = solr_doc['member_ids_ssim']
        solr_doc['visibility_ssi'] = object.visibility

        admin_set_label = object.admin_set.to_s
        solr_doc['admin_set_sim']   = admin_set_label
        solr_doc['admin_set_tesim'] = admin_set_label
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
hyrax-5.0.0.rc2 app/indexers/hyrax/work_indexer.rb
hyrax-5.0.0.rc1 app/indexers/hyrax/work_indexer.rb
hyrax-3.6.0 app/indexers/hyrax/work_indexer.rb
hyrax-4.0.0 app/indexers/hyrax/work_indexer.rb
hyrax-4.0.0.rc3 app/indexers/hyrax/work_indexer.rb
hyrax-4.0.0.rc2 app/indexers/hyrax/work_indexer.rb
hyrax-4.0.0.rc1 app/indexers/hyrax/work_indexer.rb
hyrax-3.5.0 app/indexers/hyrax/work_indexer.rb
hyrax-4.0.0.beta2 app/indexers/hyrax/work_indexer.rb
hyrax-3.4.2 app/indexers/hyrax/work_indexer.rb
hyrax-4.0.0.beta1 app/indexers/hyrax/work_indexer.rb
hyrax-3.4.1 app/indexers/hyrax/work_indexer.rb
hyrax-3.4.0 app/indexers/hyrax/work_indexer.rb
hyrax-3.3.0 app/indexers/hyrax/work_indexer.rb
hyrax-3.2.0 app/indexers/hyrax/work_indexer.rb
hyrax-3.1.0 app/indexers/hyrax/work_indexer.rb
hyrax-3.0.2 app/indexers/hyrax/work_indexer.rb
hyrax-3.0.1 app/indexers/hyrax/work_indexer.rb
hyrax-3.0.0 app/indexers/hyrax/work_indexer.rb
hyrax-3.0.0.pre.rc4 app/indexers/hyrax/work_indexer.rb