lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From karl wettin <karl.wet...@gmail.com>
Subject Re: Re : Spell Checker Index
Date Sat, 20 Jan 2007 14:08:30 GMT

20 jan 2007 kl. 14.51 skrev saikrishna venkata pendyala:

> Hai all,
>         This is what I did.
>         """
>         IndexReader reader = IndexReader.open("index");
>         //static final File INDEX_DIR = new File("index");
>         Directory directory = new RAMDirectory(index);
>         SpellChecker spellchecker = new SpellChecker(directory);
>         // To index a field of a user index:
>         spellchecker.indexDictionary(new
> LuceneDictionary(reader,"content"));
>         String[] suggestions = spellchecker.suggestSimilar 
> ("fredom", 5);
>         """
>
> The problem with above code is every time I run the code it is  
> indexing text
> in "content" field.
>                       {
> spellchecker.indexDictionary(newLuceneDictionary(reader,"content"));
> }
> Is there any way I could save the spell checker index and use it  
> straight
> away.

You can use an FSDirectory instead of a RAMDirectory? It is simple to  
load an FSDirectory to a RAMDirectory and vice verse if that is  
something you need.





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


Mime
View raw message