         # File lib/ferret/index.rb, line 392
    392:     def delete(id)
    393:       @dir.synchronize do
    394:         if id.is_a?(String) or id.is_a?(Symbol)
    395:           ensure_writer_open()
    396:           @writer.delete(@id_field, id.to_s)
    397:         elsif id.is_a?(Integer)
    398:           ensure_reader_open()
    399:           cnt = @reader.delete(id)
    400:         else
    401:           raise ArgumentError, "Cannot delete for id of type #{id.class}"
    402:         end
    403:         flush() if @auto_flush
    404:       end
    405:       return self
    406:     end