         # File lib/ferret/index.rb, line 552
    552:     def flush()
    553:       @dir.synchronize do
    554:         if @reader
    555:           if @searcher
    556:             @searcher.close
    557:             @searcher = nil
    558:           end
    559:           @reader.commit
    560:         elsif @writer
    561:           @writer.commit
    562:         end
    563:       end
    564:     end