lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karl Wettin (JIRA)" <j...@apache.org>
Subject [jira] Updated: (LUCENE-632) The creation of a spell index from a LuceneDictionary via SpellChecker.indexDictionary (Dictionary dict) fails starting with 1.9.1 (up to current svn version)
Date Mon, 24 Jul 2006 23:13:15 GMT
     [ http://issues.apache.org/jira/browse/LUCENE-632?page=all ]

Karl Wettin updated LUCENE-632:
-------------------------------

    Attachment: lazy_searcher.diff

Had no problems running the code on 2.0.0, but on the SVN version. Didn't look that close
to why. I have always passed an existing index to the SpellChecker, and would say that the
implemention you pasted is corrupt, not the API.

    Directory d2= FSDirectory.getDirectory(spellcheckpath,true); 
+    new IndexWriter(d2, null, true).close();

And when the index has been created you have to:

    spellChecker.setSpellIndex(d2);

To ensure a new Searcher is created.

Or use this patch that handle the searcher lazy. And then there is no need for you to make
any changes to your code.

> The creation of a spell index from a LuceneDictionary via SpellChecker.indexDictionary
(Dictionary dict) fails starting with 1.9.1 (up to current svn version)
> --------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-632
>                 URL: http://issues.apache.org/jira/browse/LUCENE-632
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Other
>    Affects Versions: 2.0.0, 1.9
>            Reporter: Karsten Dello
>            Priority: Minor
>         Attachments: lazy_searcher.diff
>
>
> Two different errors in 1.9.1/2.0.0 and current svn version.
> 1.9.1/2.0.0:
> at the end of indexDictionary (Dictionary dict) 
> the IndexReader-instance reader is closed.
> This causes a NullpointerException because reader has not been initialized before (neither
in that method nor in the constructor).
> Uncommenting this line (reader.close()) seems to resolve that issue.
> current svn:
> the constructor tries to create an IndexSearcher-instance for the specified path;
> as there is no index in that path - it is not created yet -  an exception is thrown.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


Mime
View raw message