lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: SpellChecker locks folder
Date Fri, 01 May 2009 21:21:02 GMT

: 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-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message