You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Naveen Belkale (JIRA)" <ji...@apache.org> on 2008/01/25 14:09:40 UTC

[jira] Issue Comment Edited: (LUCENE-1152) SpellChecker does not work properly on calling indexDictionary after clearIndex

    [ https://issues.apache.org/jira/browse/LUCENE-1152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12562485#action_12562485 ] 

belkale edited comment on LUCENE-1152 at 1/25/08 5:07 AM:
-----------------------------------------------------------------

One more small query. We have requirement where we have to add new words to our dictionary quite frequently. So multiple threads may concurrently call indexDictionary. This will cause problems as each call to indexDictionary will create a new IndexWriter. So is it possible to make indexDictionary function synchronized? Like this
  public synchronized void indexDictionary(Dictionary dict) throws IOException {
........

      was (Author: belkale):
    One more small query. We have requirement where we have to add new words to our dictionary quite frequently. So multiple threads may concurrently call index dictionary. This will cause problems as each call to indexDictionary will create a new IndexWriter. So is it possible to make indexDictionary function synchronized? Like this
  public synchronized void indexDictionary(Dictionary dict) throws IOException {
........
  
> SpellChecker does not work properly on calling indexDictionary after clearIndex
> -------------------------------------------------------------------------------
>
>                 Key: LUCENE-1152
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1152
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/*
>    Affects Versions: 2.3
>            Reporter: Naveen Belkale
>         Attachments: spellchecker.diff
>
>
> We have to call clearIndex and indexDictionary to rebuild dictionary from fresh. The call to SpellChecker clearIndex() function does not reset the searcher. Hence, when we call indexDictionary after that, many entries that are already in the stale searcher will not be indexed.
> Also, I see that IndexReader reader is used for the sole purpose of obtaining the docFreq of a given term in exist() function. This functionality can also be obtained by using just the searcher by calling searcher.docFreq. Thus, can we get away completely with reader and code associated with it like
>       if (IndexReader.isLocked(spellIndex)){
> 	IndexReader.unlock(spellIndex);
>       }
> and the reader related code in finalize?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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