lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ashish Sarna" <ashish.sa...@thepsi.com>
Subject RE: Taking backup of a Lucene index
Date Wed, 17 Apr 2013 12:10:09 GMT
The external backup utility would be used by some other person and it would
simply copy the index directory to take its backup. I have no control over
this utility.

I have ensured that nothing would be written to index before the backup
utility is executed and now just need to ensure that it does not get changed
due to searches and or Lucene housekeeping activities. 

Is there a way to ensure this? 

Does using the IndexReader.open method with 'readOnly' flag passed as 'true'
would help keeping the indexes from modifying when a search is performed?

-----Original Message-----
From: Michael McCandless [mailto:lucene@mikemccandless.com] 
Sent: Wednesday, April 17, 2013 5:13 PM
To: java-user@lucene.apache.org
Subject: Re: Taking backup of a Lucene index

On Wed, Apr 17, 2013 at 7:32 AM, Ashish Sarna <ashish.sarna@thepsi.com>
wrote:
> Thanks for your replies.
>
> However, in my scenario, an external backup utility would be used to take
> backup of the Lucene index. I just need to ensure that index do not get
> changed when a search is performed over it or due to internal Lucene
> housekeeping/optimization/merge activities.

That's fine.

You use the SnapshotDeletionPolicy to get a snapshot, and then you ask
that snapshot for the list of files, then tell your external utility
to copy those files.

Once that utility is done, you release the snapshot.

If you need the snapshot to persist even when you close the
IndexWriter/JVM and later open a new IndexWriter, use
PersistentSnapshotDeletionPolicy.

Mike McCandless

http://blog.mikemccandless.com

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





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


Mime
View raw message