Sha256: 167713bb8427cc580266f442b6ba5175a96cc1b07b8c02c36162bc7485594346

Contents?: true

Size: 1.32 KB

Versions: 2

Compression:

Stored size: 1.32 KB

Contents

module CurationConcerns
  class FileSetIndexingService < ActiveFedora::IndexingService
    include IndexesThumbnails

    def generate_solr_document
      super.tap do |solr_doc|
        solr_doc[Solrizer.solr_name('hasRelatedMediaFragment', :symbol)] = object.representative_id
        solr_doc[Solrizer.solr_name('hasRelatedImage', :symbol)] = object.thumbnail_id
        # Label is the actual file name. It's not editable by the user.
        solr_doc[Solrizer.solr_name('label')] = object.label
        solr_doc[Solrizer.solr_name('label', :stored_sortable)] = object.label
        solr_doc[Solrizer.solr_name('file_format')] = object.file_format
        solr_doc[Solrizer.solr_name('file_format', :facetable)] = object.file_format
        solr_doc[Solrizer.solr_name(:file_size, :symbol)] = object.file_size[0]
        solr_doc['all_text_timv'] = object.full_text.content
        solr_doc[Solrizer.solr_name('generic_work_ids', :symbol)] = object.generic_work_ids unless object.generic_work_ids.empty?
        solr_doc['height_is'] = Integer(object.height.first) if object.height.present?
        solr_doc['width_is'] = Integer(object.width.first) if object.width.present?
        solr_doc[Solrizer.solr_name('mime_type', :stored_sortable)] = object.mime_type
        solr_doc['thumbnail_path_ss'] = thumbnail_path
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
curation_concerns-models-0.3.0 app/indexers/curation_concerns/file_set_indexing_service.rb
curation_concerns-models-0.2.0 app/indexers/curation_concerns/file_set_indexing_service.rb