lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yakob <jacob...@opensuse-id.org>
Subject Re: flushing index
Date Sun, 26 Sep 2010 12:08:15 GMT
On 9/26/10, Uwe Schindler <uwe@thetaphi.de> wrote:
> You should close the ramwriter before doing the addindexes call. Else you
> simply copy only *committed* changes, but there are none, as the index is
> initially empty and stays empty for an outside reader (your addindexes call
> is the outside reader) until the ramwriter is closed or committed. :-)
>
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: uwe@thetaphi.de

thanks for the suggestion. but I was also asking of what source code
should I filled in this line

if (condition for flushing memory to disk has been met) { ///THIS LINE
ramWriter.close();
fsWriter.addIndexes(Directory[] {ramDir});
ramWriter = new IndexWriter(ramDir, new SimpleAnalyzer(),
true);
}
}

I mean what source code that I can put after the IF statement so that
it will force the index to be flushed?
but anyway, did I put the ramwriter.close() correctly in the above
source code? you advised me to close ramwriter before the addIndexes()
right?

thanks for your help though. :-)
-- 
http://jacobian.web.id

---------------------------------------------------------------------
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