sunspot/lib/sunspot/field_factory.rb
# 
# Generate dynamic fields based on hash returned by data accessor and
# add the field data to the document.
#
Generate dynamic fields based on hash returned by data accessor and
add the field data to the document.
Generate dynamic fields based on hash returned by data accessor and add the field data to the document .
def populate_document(document, model)
        if values = @data_extractor.value_for(model)
          values.each_pair do |dynamic_name, value|
            field_instance = build(dynamic_name)
            Util.Array(field_instance.to_indexed(value)).each do |scalar_value|
              document.add_field(
                field_instance.indexed_name.to_sym,
                scalar_value
              )
            end
          end
        end
      end
def populate_document ( document , model ) if values = @data_extractor . value_for ( model ) values . each_pair do | dynamic_name , value | field_instance = build ( dynamic_name ) Util . Array ( field_instance . to_indexed ( value ) ) . each do | scalar_value | document . add_field ( field_instance . indexed_name . to_sym , scalar_value ) end end end end
Generate dynamic fields based on hash returned by data accessor and
add the field data to the document.
Generate dynamic fields based on hash returned by data accessor and add the field data to the document .
document
<not_specific>
model
<not_specific>