protected virtual void Dispose(bool disposing) { if (disposing) { // dispose managed resources searcher.Dispose(); writer.Dispose(); analyzer.Dispose(); luceneIndexDirectory.Dispose(); } // free native resources }
/// <summary> /// Dispose of this object. /// </summary> public void Dispose() { if (_writer != null) { _writer.Optimize(); _writer.Flush(true, true, true); _writer.Dispose(); } if (_searcher != null) { _searcher.Dispose(); } if (_analyzer != null) { _analyzer.Dispose(); } if (_directory != null) { _directory.Dispose(); } }