         # File lib/ferret/index.rb, line 427
    427:     def delete(arg)
    428:       @dir.synchrolock do
    429:         ensure_writer_open()
    430:         if arg.is_a?(String) or arg.is_a?(Symbol)
    431:           ensure_writer_open()
    432:           @writer.delete(@id_field, arg.to_s)
    433:         elsif arg.is_a?(Integer)
    434:           ensure_reader_open()
    435:           cnt = @reader.delete(arg)
    436:         else
    437:           raise ArgumentError, "Cannot delete for arg of type #{arg.class}"
    438:         end
    439:         flush() if @auto_flush
    440:       end
    441:       return self
    442:     end