try {
log.info("Generating spelling suggestion index ... ");
indexReader = IndexReader.open(indexDirectory);
checker = new SpellChecker(spellDirectory);
//TODO below seems only to index "defs" , possible bug ?
checker.indexDictionary(new LuceneDictionary(indexReader, "defs"), new IndexWriterConfig(Version.LUCENE_36, null), true);
log.info("done");
} catch (IOException e) {
log.log(Level.SEVERE, "ERROR: Generating spelling: {0}", e);
} finally {
if (indexReader != null) {