documentSequence = Scan.getSequence(sequence,
IdentityDocumentFactory.class, new String[] {},
Scan.DEFAULT_DELIMITER, LOGGER);
LOGGER.info(String.format("Term processor class is %s", termProcessor.getClass()));
IndexBuilder indexBuilder = new IndexBuilder(new File(directory,basename).getAbsolutePath(), documentSequence);
indexBuilder.termProcessor(termProcessor).documentsPerBatch(
documentsPerBatch);
if (tmpDirectory != null)
indexBuilder.batchDirName(tmpDirectory.getAbsolutePath());
indexBuilder.run();
return 0;
}