You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Youngho Cho <yo...@nannet.co.kr> on 2005/09/10 01:34:03 UTC

RAMDirectory add index with other machine FSDirectory

Hello,

I would like to add RAMDirectory to another machines' FSDirectory
Is there any good way ?


Thanks,

Youngho

Re: RAMDirectory add index with other machine FSDirectory

Posted by Cheolgoo Kang <ap...@gmail.com>.
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 <yo...@nannet.co.kr> wrote:
> Hello,
> 
> I would like to add RAMDirectory to another machines' FSDirectory
> Is there any good way ?
> 
> 
> Thanks,
> 
> Youngho


-- 
Cheolgoo

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: RAMDirectory add index with other machine FSDirectory

Posted by Youngho Cho <yo...@nannet.co.kr>.
Hello Otis,

Thanks alot !.

I will try.

Thanks again,

Youngho

----- Original Message ----- 
From: "Otis Gospodnetic" <ot...@yahoo.com>
To: <ja...@lucene.apache.org>; "Youngho Cho" <yo...@nannet.co.kr>
Sent: Saturday, September 10, 2005 10:59 AM
Subject: Re: RAMDirectory add index with other machine FSDirectory


> Save it to disk using FSDirectory, zip the index directory, and copy it
> to the remote host over the socket.  There is no built-in Lucene-way of
> doing this.  You can also simply scp the index directory or use
> whatever other file transfer protocol suits you.
> 
> Otis
> 
> --- Youngho Cho <yo...@nannet.co.kr> wrote:
> 
> > Hello,
> > 
> > I would like to add RAMDirectory to another machines' FSDirectory
> > Is there any good way ?
> > 
> > 
> > Thanks,
> > 
> > Youngho

Re: RAMDirectory add index with other machine FSDirectory

Posted by Otis Gospodnetic <ot...@yahoo.com>.
Save it to disk using FSDirectory, zip the index directory, and copy it
to the remote host over the socket.  There is no built-in Lucene-way of
doing this.  You can also simply scp the index directory or use
whatever other file transfer protocol suits you.

Otis

--- Youngho Cho <yo...@nannet.co.kr> wrote:

> Hello,
> 
> I would like to add RAMDirectory to another machines' FSDirectory
> Is there any good way ?
> 
> 
> Thanks,
> 
> Youngho


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org