Sha256: 8d279168151e6d2c68d8081e4799d71335d292d58779383efb42d5ef112d8e17

Contents?: true

Size: 541 Bytes

Versions: 5

Compression:

Stored size: 541 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

5 entries across 5 versions & 1 rubygems

Version Path
dor-services-5.1.1 lib/dor/utils/solr_doc_helper.rb
dor-services-5.1.0 lib/dor/utils/solr_doc_helper.rb
dor-services-5.0.2 lib/dor/utils/solr_doc_helper.rb
dor-services-5.0.1 lib/dor/utils/solr_doc_helper.rb
dor-services-5.0.0 lib/dor/utils/solr_doc_helper.rb