FAQ
Hello

After I call the SpellChecker.indexDictionary method the directory which
contained the lucene index is locked. I cannot rename of delete the
folder (windows).

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?

thanks
Ioannis


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org

Search Discussions

  • Chris Hostetter at May 1, 2009 at 9:21 pm
    : 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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedApr 22, '09 at 8:28a
activeMay 1, '09 at 9:21p
posts2
users2
websitelucene.apache.org

2 users in discussion

John Cherouvim: 1 post Chris Hostetter: 1 post

People

Translate

site design / logo © 2022 Grokbase