Initializing an IndexWriter in Lucene.Net looks like this:
var analyzer = new Lucene.Net.Analysis.Standard.StandardAnalyzer(version);
var indexWriterConfig = new Lucene.Net.Index.IndexWriterConfig(version, analyzer);
Index = new Lucene.Net.Index.IndexWriter(luceneDir, indexWriterConfig);
That is, you can't instantiate an IndexWriter without an Analyzer. So, I would expect that calling .Dispose()
on the IndexWriter would dispose its children, including the Analyzer. However browsing the code I don't see that happening - so far. Have I missed it?
So: Does calling .Dispose()
on the IndexWriter dispose the Analyzer, and if not, why not?