lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cheolgoo Kang <>
Subject Re: RAMDirectory add index with other machine FSDirectory
Date Sat, 10 Sep 2005 02:11:15 GMT
Cause the RAMDirectory is not serializable, it's hard to send a index
to a remote computer. I think it's kind of tricky, but it would work.

1. Create a fresh new IndexWriter(let's name it toTransfer) with
temporary FSDirectory, /usr/tmp/some/directory for example.
2. Invoke the toTransfer.addIndexes(Directory[]) method with your
current RAMDirectory, it'll copy your index resides in RAMDirectory to
the temporary directory mentioned above.
3. Close the toTransfer index to flush all those modifications.
4. Zip all the files on the temporary directory, and send the zipped
file to the remote server. (FTP, HTTP, WevDAV or anything.)
5. As you expected, unzip the received zip file to a temporary
directory, like /tmp/indexFromClientA for example.
6. Load the index of the directory /tmp/indexFromClientA and, and you
finally got the client's index. You could addIndexes() to your remote
machine's FSDirectory based one.

As you know, it's NOT a good method, but I think it's the only way to do that.

On 9/10/05, Youngho Cho <> wrote:
> Hello,
> I would like to add RAMDirectory to another machines' FSDirectory
> Is there any good way ?
> Thanks,
> Youngho


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

View raw message