def update_batch(document_analyzer_pairs)
      ids = document_analyzer_pairs.collect {|da| da.first[@id_field] }
      @dir.synchronize do
        batch_delete(ids)
        ensure_writer_open()
        document_analyzer_pairs.each do |doc, analyzer|
          if analyzer
            old_analyzer = @writer.analyzer
            @writer.analyzer = analyzer
            @writer.add_document(doc)
            @writer.analyzer = old_analyzer
          else
            @writer.add_document(doc)
          end
        end
        flush()
      end      
    end
def update_batch(document_analyzer_pairs)
      ids = document_analyzer_pairs.collect {|da| da.first[@id_field] }
      @dir.synchronize do
        batch_delete(ids)
        ensure_writer_open()
        document_analyzer_pairs.each do |doc, analyzer|
          if analyzer
            old_analyzer = @writer.analyzer
            @writer.analyzer = analyzer
            @writer.add_document(doc)
            @writer.analyzer = old_analyzer
          else
            @writer.add_document(doc)
          end
        end
        flush()
      end      
    end
bulk-inserts a number of ferret documents.
 The argument has to be an array of two-element arrays each holding the document data and the analyzer to
 use for this document (which may be nil).