def to_doc
      logger.debug "creating doc for class: #{self.ferret_key}"
      Ferret::Document.new.tap do |doc|
        # store the id and class name of each item, and the unique key used for identifying the record
        # even in multi-class indexes.
        doc[:key] = self.ferret_key
        doc[:id] = self.id.to_s
        doc[:class_name] = self.class.name
      
        # iterate through the fields and add them to the document
        aaf_configuration[:defined_fields].each_pair do |field, config|
          doc[field] = self.send("#{field}_to_ferret") unless config[:ignore]
        end
        if aaf_configuration[:boost]
          if self.respond_to?(aaf_configuration[:boost])
            boost = self.send aaf_configuration[:boost]
            doc.boost = boost.to_i if boost
          else
            logger.error "boost option should point to an instance method: #{aaf_configuration[:boost]}"
          end
        end
      end
    end
def to_doc
      logger.debug "creating doc for class: #{self.ferret_key}"
      Ferret::Document.new.tap do |doc|
        # store the id and class name of each item, and the unique key used for identifying the record
        # even in multi-class indexes.
        doc[:key] = self.ferret_key
        doc[:id] = self.id.to_s
        doc[:class_name] = self.class.name
      
        # iterate through the fields and add them to the document
        aaf_configuration[:defined_fields].each_pair do |field, config|
          doc[field] = self.send("#{field}_to_ferret") unless config[:ignore]
        end
        if aaf_configuration[:boost]
          if self.respond_to?(aaf_configuration[:boost])
            boost = self.send aaf_configuration[:boost]
            doc.boost = boost.to_i if boost
          else
            logger.error "boost option should point to an instance method: #{aaf_configuration[:boost]}"
          end
        end
      end
    end
turn this instance into a ferret document (which basically is a hash of
 fieldname => value pairs)