def batch_delete(docs)
      docs = docs.keys if docs.is_a?(Hash)
      raise ArgumentError, "must pass Array or Hash" unless docs.is_a? Array
      ids = []
      terms = []
      docs.each do |doc|
        case doc
        when String   then terms << doc
        when Symbol   then terms << doc.to_s
        when Integer  then ids << doc
        else
          raise ArgumentError, "Cannot delete for arg of type #{id.class}"
        end
      end
      if ids.size > 0
        ensure_reader_open
        ids.each {|id| @reader.delete(id)}
      end
      if terms.size > 0
        ensure_writer_open()
        terms.each { |t| @writer.delete(@id_field, t) }
        # TODO with Ferret trunk this would work:
        # @writer.delete(@id_field, terms)
      end
      return self
    end
def batch_delete(docs)
      docs = docs.keys if docs.is_a?(Hash)
      raise ArgumentError, "must pass Array or Hash" unless docs.is_a? Array
      ids = []
      terms = []
      docs.each do |doc|
        case doc
        when String   then terms << doc
        when Symbol   then terms << doc.to_s
        when Integer  then ids << doc
        else
          raise ArgumentError, "Cannot delete for arg of type #{id.class}"
        end
      end
      if ids.size > 0
        ensure_reader_open
        ids.each {|id| @reader.delete(id)}
      end
      if terms.size > 0
        ensure_writer_open()
        terms.each { |t| @writer.delete(@id_field, t) }
        # TODO with Ferret trunk this would work:
        # @writer.delete(@id_field, terms)
      end
      return self
    end
If +docs+ is a Hash or an Array then a batch delete will be performed.
 If +docs+ is an Array then it will be considered an array of +id+'s. If
 it is a Hash, then its keys will be used instead as the Array of
 document +id+'s. If the +id+ is an Integers then it is considered a
 Ferret document number and the corresponding document will be deleted.
 If the +id+ is a String or a Symbol then the +id+ will be considered a
 term and the documents that contain that term in the +:id_field+ will
 be deleted.

 docs:: An Array of docs to be deleted, or a Hash (in which case the keys
 are used)

 ripped from Ferret trunk.