Class: Hyrax::DeepIndexingService

Inherits:
BasicMetadataIndexer show all
Defined in:
app/indexers/hyrax/deep_indexing_service.rb

Instance Method Summary collapse

Instance Method Details

#add_assertionsObject



22
23
24
25
# File 'app/indexers/hyrax/deep_indexing_service.rb', line 22

def add_assertions(*)
  fetch_external
  super
end

#append_to_solr_doc(solr_doc, solr_field_key, field_info, val) ⇒ Object

We’re overiding the default indexer in order to index the RDF labels. In order for this to be called, you must specify at least one default indexer on the property.

Parameters:

  • solr_doc (Hash)
  • solr_field_key (String)
  • field_info (Hash)
  • val (ActiveTriples::Resource, String)


10
11
12
13
14
15
16
17
18
19
20
# File 'app/indexers/hyrax/deep_indexing_service.rb', line 10

def append_to_solr_doc(solr_doc, solr_field_key, field_info, val)
  return super unless object.controlled_properties.include?(solr_field_key.to_sym)
  case val
  when ActiveTriples::Resource
    append_label_and_uri(solr_doc, solr_field_key, field_info, val)
  when String
    append_label(solr_doc, solr_field_key, field_info, val)
  else
    raise ArgumentError, "Can't handle #{val.class}"
  end
end