Class: Sufia::GenericFileIndexingService

Inherits:
ActiveFedora::IndexingService
  • Object
show all
Defined in:
app/services/sufia/generic_file_indexing_service.rb

Constant Summary collapse

STORED_INTEGER =
Solrizer::Descriptor.new(:integer, :stored)

Instance Method Summary collapse

Instance Method Details

#generate_solr_documentObject



5
6
7
8
9
10
11
12
13
# File 'app/services/sufia/generic_file_indexing_service.rb', line 5

def generate_solr_document
  super.tap do |solr_doc|
    solr_doc[Solrizer.solr_name('label')] = 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['all_text_timv'] = object.full_text.content
    solr_doc[Solrizer.solr_name('file_size', STORED_INTEGER)] = object.content.size.to_i
  end
end