Sha256: 2451c8ae038838f07163d8b4690d0be0cbe7722eacc53c28b00b635718ca3e5c

Contents?: true

Size: 778 Bytes

Versions: 8

Compression:

Stored size: 778 Bytes

Contents

# The goal of this method is to have no dependency on OM, so that NOM or RDF datastreams could use this.

module Solrizer
  module Common
    def self.included(klass)
      klass.send(:extend, ClassMethods)
    end

    module ClassMethods
      # @param [String] field_name_base the name of the solr field (without the type suffix)
      # @param [Object] value the value to insert into the document
      # @param [Array] index_as list of indexers to use (e.g. [:searchable, :facetable])
      # @param [Hash] solr_doc the solr_doc to insert into.
      def create_and_insert_terms(field_name_base, value, index_as, solr_doc)
        index_as.each do |indexer|
          Solrizer.insert_field(solr_doc, field_name_base, value, indexer)
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
solrizer-4.1.0 lib/solrizer/common.rb
solrizer-4.0.0 lib/solrizer/common.rb
solrizer-3.4.1 lib/solrizer/common.rb
solrizer-3.4.0 lib/solrizer/common.rb
solrizer-3.3.0 lib/solrizer/common.rb
solrizer-3.2.0 lib/solrizer/common.rb
solrizer-3.1.1 lib/solrizer/common.rb
solrizer-3.1.0 lib/solrizer/common.rb