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
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
helper to defines a method which adds the given field to a ferret
 document instance