Hello

I've recently implemented a FuzzySuggester and an AnalyingInFixSuggester
with an web app.  It works great, and performs well.

I'd like to be able to reload or re-build the underlying indexes with an
updated dictionary periodically throughout the day without having to
restart the app.

I've tried calling the load() method on the FuzzySuggester and the build()
method on the AnalyzingInFixSuggester on 'built' suggesters, but based on
heap memory usage, it appears as though the indexes are not being replaced.
 In other words, when one the suggesters is initially constructed and
built, I see heap memory usage go up by approximately 20 MB.  When, I
invoked the build() or load() method a second time, heap memory goes up by
another 20MB.

A code snippet is below:

     StandardAnalyzer sa = new StandardAnalyzer(Version.LUCENE_44);
     File tempDir = new File("C:/index/infixsuggestor/");
     AnalyzingInfixSuggester suggester = new
AnalyzingInfixSuggester(Version.LUCENE_44, tempDir, sa, sa, 3);
    FileDictionary fDictionary = new FileDictionary(new
FileReader("dictionary.txt") );
    suggester.build(fDictionary);

time passes....the dictionary.txt file has been updated, need to do a
complete reload of it.

     suggester.build(fDictionary);

is this correct?  Should a 'new' suggester be created instead, and the old
one discarded?

Thanks

Reply via email to