Here is one way to do it:
You can read/open an index at any point, even when it's being modified.  You 
can then open a new FSDirectory pointing to a new directory and add your 
original FSDirectory to that new FSDirectory.  That will copy the index.  Of 
course, any new documents you add to the original index after you've opened it 
will not be copied.  The same goes for any documents that were still buffered 
in memory when you opened the index, and were not yet flushed to disk.

See also: 
http://www.mail-archive.com/lucene-user@jakarta.apache.org/msg12709.html

Otis



----- Original Message ----
From: "Rajendranath, Divya" <[EMAIL PROTECTED]>
To: java-user@lucene.apache.org
Sent: Tuesday, April 10, 2007 12:06:12 PM
Subject: Copy index while updating the index

Hello,

I have a scenario, where we need to set up our application, that uses
Lucene (and has on-demand indexing of documents) in Disaster-recovery
site.

The simple files/attachments used by our application can be simply
copied to the DR site just by syncing (manual copying).

Yes, we can also copy the index directory, but problem arises when we
have copy the index directory, while the index directory is being
updated, that means the Index is open.

Wont this corrupt the index directory.

Does Lucene 2.0 have support for copying opened index directory, without
corrupting it.

Please do let me know.


Thanks,
Divya.

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





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

Reply via email to