         # File lib/ferret/index.rb, line 588
    588:     def persist(directory, create = true)
    589:       synchronize do
    590:         flush()
    591:         old_dir = @dir
    592:         if directory.is_a?(String)
    593:           @dir = FSDirectory.new(directory, create)
    594:         elsif directory.is_a?(Ferret::Store::Directory)
    595:           @dir = directory
    596:         end
    597:         @dir.extend(MonitorMixin)
    598:         @options[:dir] = @dir
    599:         @options[:create_if_missing] = true
    600:         add_indexes([old_dir])
    601:       end
    602:     end