: In the source of SpellChecker lines 352-353 I see that after the indexing is : done the index is reopened: : searcher.close(); : searcher = new IndexSearcher(this.spellIndex); : : Why does that second line exist at all?
when you instantiate a SpellChecker object, it opens a Searcher for reuse on all future suggest* method calls. *if* you call indexDictionary it first does all the additions to hte spellchecker index, and then "reopens" the IndexSearcher (those two lines) ... the result being that the SpellChecker is still usable by other threads while the bulk of the index work is going on. In short: even if you didn't call indexDictionary, you'd still have There does seem to be a nasty bug in the SpellChecker API however: there is no way to "close" the SpellChecker, and have it free all it's resources (namely: the IndexSearcher it has open) I've opened a bug... https://issues.apache.org/jira/browse/LUCENE-1627 -Hoss --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org