fields:: Fields or instance methods of ActiveRecord model to be indexed.
 config:: ActsAsIndexed::Configuration instance.
 Adds +record+ to the index.
513517
def add_record(record)
      return unless allow_indexing?(record)

      condensed_record = condense_record(record)
      atoms = add_occurences(condensed_record, record.id)

      @storage.add(atoms)
    end
290102
def build_record
      record = model.new
      record.send("#{parent_association.name}=", parent_record) if parent_record
      record.build_defaults if record.respond_to?(:build_defaults)
      record
    end
260668
def define_to_field_method(field, options = {})
      method_name = "#{field}_to_ferret"
      return if instance_methods.include?(method_name) # already defined
      aaf_configuration[:defined_fields] ||= {}
      aaf_configuration[:defined_fields][field] = options
      dynamic_boost = options[:boost] if options[:boost].is_a?(Symbol)
      via = options[:via] || field
      define_method(method_name.to_sym) do
        val = begin
          content_for_field_name(field, via, dynamic_boost)
        rescue
          logger.warn("Error retrieving value for field #{field}: #{$!}")
          ''
        end
        logger.debug("Adding field #{field} with value '#{val}' to index")
        val
      end
    end
604324
def add_fields(self, **fields):
        """"""
        self.__class__ = type(self.__class__.__name__,
                            (self.__class__,), fields)
        for k, v in fields.items():
            v.init_inst(self)
1366131
def attributes
      fields.each_with_object(HashWithIndifferentAccess.new) do |field, acc|
        acc[field.alias] = field.value
      end
    end
290743
def add_log_fields(self, fields: Dict[str, Any]):
        
        self._log_fields.add_fields(fields)
1176166
def add_has_ones(row, attrs)
      @config.has_ones.each do |name,assoc_config|
        fields = (assoc_config.fields - assoc_config.export_only_fields).map(&:to_s)
        fields.each do |f|
          csv_name = "#{name}_#{f}"
          row.has_key? csv_name or next
          (attrs[name.to_s] ||= {})[f] = row.field "#{name}_#{f}"
        end
      end
    end
1112276
def insert_record_by_fieldspecs_with_values(
            self,
            table: str,
            fieldspeclist: FIELDSPECLIST_TYPE) -> int:
        
        fields = []
        values = []
        for fs in fieldspeclist:
            fields.append(fs["name"])
            values.append(fs["value"])
        return self.insert_record(table, fields, values)
835418
def add_records(records)
      atoms = ActiveSupport::OrderedHash.new
      records_count = 0

      records.each do |record|
        next unless allow_indexing?(record)
        records_count += 1

        condensed_record = condense_record(record)
        atoms = add_occurences(condensed_record, record.id, atoms)
      end

      @storage.add(atoms, records_count)
    end
370515
def field_for(name, predicate, options)
      Tripod::Fields::Standard.new(name, predicate, options)
    end
536064
def do_add_existing
      parent_record = nested_parent_record(:update)
      @record = active_scaffold_config.model.find(params[:associated_id])
      if parent_record && @record
        parent_record.send(nested.association.name) << @record
        parent_record.save
      else
        false
      end
    end
190474
def cast_with_active_record(object, type)
      cast = cast_without_active_record(object, type)
      return cast if !defined?(::ActiveRecord::Base)

      if object.is_a?(::ActiveRecord::Base)
        cast = :active_record_instance
      elsif object.is_a?(::ActiveModel::Errors)
        cast = :active_model_error
      elsif object.is_a?(Class) && object.ancestors.include?(::ActiveRecord::Base)
        cast = :active_record_class
      elsif type == :activerecord_relation || object.class.ancestors.include?(::ActiveRecord::Relation)
        cast = :array
      end
      cast
    end
956061
def fields
      tripod_superclasses.map { |c| c.instance_variable_get(:@fields) }.reduce do |acc,class_fields|
        class_fields.merge(acc)
      end
    end
819610
def update_fields(fields)
      attributes[:action_id]          = fields['id'] || attributes[:action_id]
      attributes[:text]               = fields['data']['text'] || attributes[:text]
      attributes[:date]               = Time.iso8601(fields['date']) if fields.has_key?('date')
      attributes[:member_creator_id]  = fields['idMemberCreator'] || attributes[:member_creator_id]
      self
    end
1286581
def field(name)
      fields = @setup.text_fields(name)
      if fields
        if fields.length == 1
          fields.first
        else
          raise(
            Sunspot::UnrecognizedFieldError,
            "The text field with name #{name} has incompatible configurations for the classes #{@setup.type_names.join(', ')}"
          )
        end
      end
    end
630599
def update_fields(fields)
      attributes[:id]        = fields['id'] || attributes[:id]
      attributes[:idPlugin]  = fields['idPlugin'] || attributes[:idPlugin]
      attributes[:scope]     = fields['scope'] || attributes[:scope]
      attributes[:value]     = JSON.parse(fields['value']).presence if fields.has_key?('value')
      attributes[:idModel]   = fields['idModel'] || attributes[:idModel]
      attributes[:access]    = fields['access'] || attributes[:access]
      self
    end
1089704
function addField(fields) {
  for (const fieldName in fields) {
    if (reservedFieldNames.indexOf(fieldName) >= 0) {
      throw new InvalidDefinitionError(this.name, 'field %s is reserved name', fieldName);
    }
    const field = Type.createField(this, fieldName, fields[fieldName]);
    if (field.props.unique && field.props.category === 'entity') {
      let unique = field.props.unique,
        message = `${fieldName} is unique`;
      if (typeof unique === 'string') message = unique;
      const index = {
        name: `${this.table}_${field.props.column}`,
        fields: [fieldName], unique: true, message,
      };
      this.indexes.push(index);
    }

    this.fields[fieldName] = field;
  }
}