lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yakob <>
Subject flushing index
Date Sun, 26 Sep 2010 04:17:12 GMT
hello all,
I am here to ask about lucene in flushing indexes.
below is a pseudocode I get from the book lucene in action.

FSDirectory fsDir = FSDirectory.getDirectory("/tmp/index",
RAMDirectory ramDir = new RAMDirectory();
IndexWriter fsWriter = IndexWriter(fsDir,
new SimpleAnalyzer(), true);
IndexWriter ramWriter = new IndexWriter(ramDir,
new SimpleAnalyzer(), true);
while (there are documents to index) {
... create Document ...
if (condition for flushing memory to disk has been met) { ///THIS LINE
fsWriter.addIndexes(Directory[] {ramDir});
ramWriter = new IndexWriter(ramDir, new SimpleAnalyzer(),

the above code has a condition to which the index need to be flush
from RAMDirectory to the disk. what I am asking is that what is the
correct source code to be used? I mean what is the source code for
flushing indexes? maybe some of you had tried it so can help me out
here. I am a bit stuck at this point. any help would be appreciated.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message