I've added a FAQ that may help you with this, "How do i get code written for Lucene 1.4.x to work with Lucene 2.x?"
http://wiki.apache.org/jakarta-lucene/LuceneFAQ#head-d09fdfc8a6335eab4e3f3dc8ac41a40a3666318e : Date: Tue, 26 Sep 2006 20:56:57 -0000 : From: Chris Salem <[EMAIL PROTECTED]> : Reply-To: java-user@lucene.apache.org, Chris Salem <[EMAIL PROTECTED]> : To: java-user@lucene.apache.org : Subject: spell checker : : Does anyone have sample code on how to build a dictionary? : : I found this article online and but it uses version 1.4.3 and it doesn't seem to work on 2.0.0: http://today.java.net/pub/a/today/2005/08/09/didyoumean.html?page=1 : : Here's the code I have: : : indexReader = IndexReader.open(originalIndexDirectory); : Dictionary dictionary = new LuceneDictionary(indexReader, "experience_desired"); : SpellChecker spellChckr = new SpellChecker(spellIndexDirectory); : spellChckr.indexDictionary(dictionary); : I'm getting a null pointer exception when I call indexDirectory(). : Here's how I index the field "experience_desired": : doc.add(new Field("experience_desired", value, Field.Store.NO, Field.Index.TOKENIZED)); : Is there another way I should do it so there is a way to build a dictionary on that field? : : Thanks : : Chris Salem : 440.946.5214 x5458 : [EMAIL PROTECTED] : : (The following links were included with this email:) : http://today.java.net/pub/a/today/2005/08/09/didyoumean.html?page=1 : : mailto:[EMAIL PROTECTED] : : : : (The following links were included with this email:) : http://today.java.net/pub/a/today/2005/08/09/didyoumean.html?page=1 : : mailto:[EMAIL PROTECTED] : : : -Hoss --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]