Sha256: 66f04a712f060acc7d14dae9dc89d378f706cdb889de350fda5969daf7b09e8b

Contents?: true

Size: 537 Bytes

Versions: 1

Compression:

Stored size: 537 Bytes

Contents

module SolrDocHelper

  def add_solr_value(solr_doc, field_name, value, field_type = :default, index_types = [:searchable])
    if Solrizer::VERSION > "3"
      case field_type
        when :symbol
          index_types << field_type
      end
      ::Solrizer.insert_field(solr_doc, field_name, value, *index_types)
    else
      index_types.each { |index_type|
        ::Solrizer::Extractor.insert_solr_field_value(solr_doc, ::ActiveFedora::SolrService.solr_name(field_name, field_type, index_type), value)
      }
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dor-services-5.2.0 lib/dor/utils/solr_doc_helper.rb