public int doLogic() throws IOException {
Directory dir = getRunData().getDirectory();
Analyzer analyzer = getRunData().getAnalyzer();
Config config = getRunData().getConfig();
boolean cmpnd = config.get("compound",true);
int mrgf = config.get("merge.factor",DEFAULT_MERGE_PFACTOR);
int mxbf = config.get("max.buffered",DEFAULT_MAX_BUFFERED);
int mxfl = config.get("max.field.length",DEFAULT_MAX_FIELD_LENGTH);
double flushAtRAMUsage = config.get("ram.flush.mb", DEFAULT_RAM_FLUSH_MB);
boolean autoCommit = config.get("autocommit", DEFAULT_AUTO_COMMIT);
IndexWriter writer = new IndexWriter(dir, autoCommit, analyzer, false);
// must update params for newly opened writer
writer.setRAMBufferSizeMB(flushAtRAMUsage);
writer.setMaxBufferedDocs(mxbf);