File tmpDirFile = Files.createTempDir();
int maxMergeFactor = conf.getInt(MAX_MERGE_FACTOR_KEY, -1);
Preconditions.checkArgument(maxMergeFactor > 0);
Directory directory = new SimpleFSDirectory(tmpDirFile, NoLockFactory.getNoLockFactory());
IndexWriter writer = LuceneIndexOutputFormat.createIndexWriter(
directory,
new LuceneIndexOutputFormat.NeverTokenizeAnalyzer(),
maxMergeFactor);