lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yakob <>
Subject Re: integrating RAMDirectory in FSDirectory
Date Sat, 16 Oct 2010 16:47:36 GMT
On 10/13/10, Erick Erickson <> wrote:
> Try IndexWrite.addIndexes. I confess that I haven't used that since
> 2.4, but I suspect it's what you want.

ok after I started asking around in stackoverflow regarding this
problem. someone was kind enough to give an answer. well sort of.

private int index(File indexDir, File dataDir, String suffix) throws Exception {
    RAMDirectory ramDir = new RAMDirectory();          // 1
    IndexWriter indexWriter = new IndexWriter(
            ramDir,                                    // 2
            new SimpleAnalyzer(),
    indexDirectory(indexWriter, dataDir, suffix);
    int numIndexed = indexWriter.maxDoc();

    Directory.copy(ramDir,; // 3

    return numIndexed;

what I am asking now is that the last line.

Directory.copy(ramDir,; // 3

the above line is wrong when I try to compile it, as lucene didn't
reserve any keyword "copy" in its class. so is there any workaround
this problem? what's the best solution to copy directory from
RAMDirectory to FSDirectory besides using copy? thanks.

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

View raw message