         # File lib/ferret/index.rb, line 701
    701:       def ensure_writer_open()
    702:         raise "tried to use a closed index" if not @open
    703:         return if @writer
    704:         if @reader
    705:           @searcher.close if @searcher
    706:           @reader.close
    707:           @reader = nil
    708:           @searcher = nil
    709:         end
    710:         @writer = IndexWriter.new(@options)
    711:       end