Module: Solrizer::Common::ClassMethods

Defined in:
lib/solrizer/common.rb

Instance Method Summary collapse

Instance Method Details

#create_and_insert_terms(field_name_base, value, index_as, solr_doc) ⇒ Object

Parameters:

  • field_name_base (String)

    the name of the solr field (without the type suffix)

  • value (Object)

    the value to insert into the document

  • index_as (Array)

    list of indexers to use (e.g. [:searchable, :facetable])

  • solr_doc (Hash)

    the solr_doc to insert into.



14
15
16
17
18
# File 'lib/solrizer/common.rb', line 14

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