Class: Hyrax::AdministrativeSetIndexer

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

Overview

Indexes Hyrax::AdministrativeSet 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/administrative_set_indexer.rb', line 12

def to_solr # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength
  super.tap do |solr_doc|
    solr_doc[Hyrax.config.collection_type_index_field.to_sym] = Array(resource.try(:collection_type_gid)&.to_s)
    solr_doc[:alternative_title_tesim] = resource.alternative_title
    solr_doc[:creator_ssim]            = [resource.creator]
    solr_doc[:creator_tesim]           = [resource.creator]
    solr_doc[:description_tesim]       = resource.description
    solr_doc[:generic_type_sim]        = ['Admin Set']
    solr_doc[:thumbnail_path_ss]       = Hyrax::CollectionThumbnailPathService.call(resource)
  end
end