         # File lib/ferret/index.rb, line 607
    607:     def add_indexes(indexes)
    608:       @dir.synchrolock do
    609:         ensure_writer_open()
    610:         indexes = [indexes].flatten   # make sure we have an array
    611:         return if indexes.size == 0 # nothing to do
    612:         if indexes[0].is_a?(Index)
    613:           indexes.delete(self) # don't merge with self
    614:           indexes = indexes.map {|index| index.reader }
    615:         elsif indexes[0].is_a?(Ferret::Store::Directory)
    616:           indexes.delete(@dir) # don't merge with self
    617:           indexes = indexes.map {|dir| IndexReader.new(dir) }
    618:         elsif indexes[0].is_a?(IndexReader)
    619:           indexes.delete(@reader) # don't merge with self
    620:         else
    621:           raise ArgumentError, "Unknown index type when trying to merge indexes"
    622:         end
    623:         ensure_writer_open
    624:         @writer.add_readers(indexes)
    625:       end
    626:     end