Overload List

  NameDescription
Public methodCommit()()()()

Commits all pending changes (added & deleted documents, optimizations, segment merges, added indexes, etc.) to the index, and syncs all referenced index files, such that a reader will see the changes and the index updates will survive an OS or machine crash or power loss. Note that this does not wait for any running background merges to finish. This may be a costly operation, so you should test the cost in your application and do it only when really necessary.

Note that this operation calls Directory.sync on the index files. That call should not return until the file contents & metadata are on stable storage. For FSDirectory, this calls the OS's fsync. But, beware: some hardware devices may in fact cache writes even during fsync, and return before the bits are actually on stable storage, to give the appearance of faster performance. If you have such a device, and it does not have a battery backup (for example) then on power loss it may still lose data. Lucene cannot guarantee consistency on such devices.

NOTE: if this method hits an OutOfMemoryError you should immediately close the writer. See above for details.

Public methodCommit(IDictionary<(Of <<'(String, String>)>>))
Commits all changes to the index, specifying a commitUserData Map (String -> String). This just calls {@link #PrepareCommit(Map)} (if you didn't already call it) and then {@link #finishCommit}.

NOTE: if this method hits an OutOfMemoryError you should immediately close the writer. See above for details.

See Also