         # File lib/ferret/index.rb, line 851
    851:       def ensure_writer_open()
    852:         raise "tried to use a closed index" if not @open
    853:         return if @writer
    854:         if @reader
    855:           @searcher.close if @searcher
    856:           @reader.close
    857:           @reader = nil
    858:           @searcher = nil
    859:         end
    860:         @writer = IndexWriter.new(@options)
    861:       end