Class: Hyrax::ValkyrieWorkIndexer

Inherits:
ValkyrieIndexer show all
Includes:
PermissionIndexer, ResourceIndexer, VisibilityIndexer
Defined in:
app/indexers/hyrax/valkyrie_work_indexer.rb

Overview

Indexes Hyrax::Work objects

Instance Attribute Summary

Attributes inherited from ValkyrieIndexer

#resource

Instance Method Summary collapse

Methods inherited from ValkyrieIndexer

for, #generate_solr_document, #initialize

Constructor Details

This class inherits a constructor from Hyrax::ValkyrieIndexer

Instance Method Details

#to_solrObject

rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength


12
13
14
15
16
17
18
19
20
21
22
# File 'app/indexers/hyrax/valkyrie_work_indexer.rb', line 12

def to_solr # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength
  super.tap do |solr_doc|
    solr_doc['generic_type_si'] = 'Work'
    solr_doc['suppressed_bsi'] = suppressed?(resource)
    solr_doc['admin_set_id_ssim'] = [resource.admin_set_id.to_s]
    solr_doc['member_of_collection_ids_ssim'] = resource.member_of_collection_ids.map(&:to_s)
    solr_doc['member_ids_ssim'] = resource.member_ids.map(&:to_s)
    solr_doc['depositor_ssim'] = [resource.depositor]
    solr_doc['depositor_tesim'] = [resource.depositor]
  end
end