// hao: autocommit is set to false with this constructor
IndexWriter idxWriter = new IndexWriter(_directory, analyzer, create, MaxFieldLength.UNLIMITED);
// TODO disable compound file for RAMDirecory when lucene bug is fixed
idxWriter.setUseCompoundFile(false);
idxWriter.setMergeScheduler(_mergeScheduler);
ZoieMergePolicy mergePolicy = new ZoieMergePolicy(idxWriter);
mergePolicy.setMergePolicyParams(_mergePolicyParams);
idxWriter.setMergePolicy(mergePolicy);
idxWriter.setRAMBufferSizeMB(3);
if (similarity != null)
{