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 <[EMAIL PROTECTED]> wrote:
> Hello,
> 
> I would like to add RAMDirectory to another machines' FSDirectory
> Is there any good way ?
> 
> 
> Thanks,
> 
> Youngho


-- 
Cheolgoo

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to