app/services/rdf/deep_indexing_service.rb
# Appends the uri to the default solr field and puts the label (if
# found) in the label solr field.
#
# @param [Hash] solr_doc
# @param [String] solr_field_key
# @param [Hash] field_info
# @param [Array] val an array of two elements, first is a string
#     (the uri) and the second is a hash with one key: `:label`
Appends the uri to the default solr field and puts the label (if
found) in the label solr field.
Appends the uri to the default solr field and puts the label ( if found ) in the label solr field .
def append_label_and_uri(solr_doc, solr_field_key, field_info, val)
    val = val.solrize
    self.class.create_and_insert_terms(solr_field_key,
                                       val.first,
                                       field_info.behaviors, solr_doc)
    return unless val.last.is_a? Hash
    self.class.create_and_insert_terms("#{solr_field_key}_label",
                                       label(val),
                                       field_info.behaviors, solr_doc)
  end
def append_label_and_uri ( solr_doc , solr_field_key , field_info , val ) val = val . solrize self . class . create_and_insert_terms ( solr_field_key , val . first , field_info . behaviors , solr_doc ) return unless val . last . is_a? Hash self . class . create_and_insert_terms ( "#{solr_field_key}_label" , label ( val ) , field_info . behaviors , solr_doc ) end
Appends the uri to the default solr field and puts the label (if
found) in the label solr field.
Appends the uri to the default solr field and puts the label ( if found ) in the label solr field .
# begin #   # TODO This should not be in this method because it's slow. We #   # should run it in a background job. #   # See https://github.com/OregonDigital/oregondigital/blob/master/lib/oregon_digital/rdf/deep_fetch.rb #   val.fetch # rescue SocketError, IOError => e #   Rails.logger.error "Couldn't fetch RDF label "\ #                      "for #{val.id}\n#{e.message}" # end
solr_doc
solr_field_key
field_info
val
val an array of two elements, first is a string (the uri) and the second is a hash with one key: `:label`
val an array of two elements first is a string ( the uri ) and the second is a hash with one key : ` : label `