         # File lib/ferret/index.rb, line 711
    711:     def flush()
    712:       @dir.synchronize do
    713:         if @reader
    714:           if @searcher
    715:             @searcher.close
    716:             @searcher = nil
    717:           end
    718:           @reader.commit
    719:         elsif @writer
    720:           @writer.close
    721:           @writer = nil
    722:         end
    723:       end
    724:     end