Expert: prepare for commit, specifying commitUserData Map (String -> String). This does the first phase of 2-phase commit. This method does all steps necessary to commit changes since this writer was opened: flushes pending added and deleted docs, syncs the index files, writes most of next segments_N file. After calling this you must call either Commit() to finish the commit, or Rollback() to revert the commit and undo all changes done since the writer was opened.
You can also just call Commit(IDictionary{string,string}) directly without prepareCommit first in which case that method will internally call prepareCommit.
NOTE: if this method hits an OutOfMemoryError you should immediately close the writer. See above for details.