Support committing Lucene writes within a fixed interval

The ramBufferSize and maxBufferedDocs options control how often the
writer is flushed, but this does not fsync files on disk and thus
might not be permanent, particularly in a machine under heavy load.

Add an option commitWithin to bound the time between calls to commit.
Give each sub-index its own executor to flush and commit outstanding
changes. Non-positive periods trigger commit on every write.

Change-Id: Idfaf17a1eeb9240f25ee1fc842bdf4f8c9b873c3
diff --git a/Documentation/config-gerrit.txt b/Documentation/config-gerrit.txt
index 733a9eb..66f9d82 100644
--- a/Documentation/config-gerrit.txt
+++ b/Documentation/config-gerrit.txt
@@ -1880,6 +1880,20 @@
 Defaults to -1, meaning no maximum is set and the writer will flush
 according to RAM usage.
 
+[[index.name.commitWithin]]index.name.commitWithin::
++
+Only used when the type is `LUCENE`.
++
+Determines the period at which changes are automatically committed to
+stable store on disk. This is a costly operation and may block
+additional index writes, so lower with caution.
++
+If zero or negative, changes are committed after every write. This is
+very costly but may be useful if offline reindexing is infeasible, or
+for development servers.
++
+Defaults to 300000 ms (5 minutes).
+
 Sample index configuration:
 ----
 [index]