        # File lib/ferret/document.rb, line 61
    61:     def to_s
    62:       buf = ["Document {"]
    63:       self.keys.sort_by {|key| key.to_s}.each do |key|
    64:         val = self[key]
    65:         val_str = if val.instance_of? Array then %{["#{val.join('", "')}"]}
    66:                   elsif val.is_a? Field then val.to_s
    67:                   else %{"#{val.to_s}"}
    68:                   end
    69:         buf << "  :#{key} => #{val_str}"
    70:       end
    71:       buf << ["}#{@boost == 1.0 ? "" : "^" + @boost.to_s}"]
    72:       return buf.join("\n")
    73:     end