Class: Hyrax::Indexers::AdministrativeSetIndexer

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

Overview

Indexes Hyrax::AdministrativeSet objects

Direct Known Subclasses

AdministrativeSetIndexer

Instance Attribute Summary

Attributes inherited from ResourceIndexer

#resource

Instance Method Summary collapse

Methods inherited from ResourceIndexer

for, #generate_solr_document, #initialize

Constructor Details

This class inherits a constructor from Hyrax::Indexers::ResourceIndexer

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/indexers/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