public void Commit() { lock (_lock) { _writer.Commit(); if (_searcher != null) { _searcher.Dispose(); _searcher = null; } } }