: How can I speed it up? don't construct a new LuceneDictionary/IndexReader on every "suggest" call ... construct them once, and reuse them for each suggestion.
: My temporary method: : public static Vector suggest(String query, String indexName, String field, : float accuracy) { : Vector v = new Vector(); : String[] suggestions = null; : : try { : SpellChecker spellchecker = new SpellChecker(new RAMDirectory()/*, new : JaroWinklerDistance()*/); : spellchecker.indexDictionary(new : LuceneDictionary(IndexReader.open(indexName), field)); : spellchecker.setAccuracy(accuracy); : suggestions = spellchecker.suggestSimilar(query, 5); : } catch (Exception e) {} : : for(int i = 0; i < suggestions.length; i++) { : v.add(suggestions[i]); : } : : return v; : } -Hoss --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org