Lucene: don't commit the index after every write
When constructing a SearcherManager with an IndexWriter, as SubIndex
does, the returned searcher has immediate access to the unflushed
writes, so there is no need to commit after every write to make the
writes visible in the running process. This allows us to "decouple
durability to hardware/OS crashes from visibility of changes to a new
IndexReader" [1].
Since we don't know exactly when changes will get committed to disk,
start a thread to periodically refresh the SearcherManagers. The 100ms
poll time is a bit of a guess, but [1] says even 50ms should not be a
significant load.
[1] http://blog.mikemccandless.com/2011/11/near-real-time-readers-with-lucenes.html
Change-Id: I1d413e8334057e1b04f9d6414635a2d1c53507f4
3 files changed