final AnalyzerFactory factory = new AnalyzerFactory(job);
final IndexWriter writer = // build locally first
new IndexWriter(
FSDirectory.open(new File(fs.startLocalOutput(perm, temp).toString())),
new NutchDocumentAnalyzer(job), true,
new MaxFieldLength(IndexWriter.DEFAULT_MAX_FIELD_LENGTH));
writer.setMergeFactor(job.getInt("indexer.mergeFactor", 10));
writer.setMaxBufferedDocs(job.getInt("indexer.minMergeDocs", 100));
writer.setMaxMergeDocs(job.getInt("indexer.maxMergeDocs",
Integer.MAX_VALUE));