lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: Taking backup of a Lucene index
Date Thu, 18 Apr 2013 17:38:13 GMT
On Wed, Apr 17, 2013 at 8:10 AM, Ashish Sarna <ashish.sarna@thepsi.com> wrote:
> 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.

OK.

> 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?

Safest is to close the IndexWriter.

But you could probably get away with 1) stopping all indexing actions,
2) commit, 3) IndexWriter.waitForMerges and only once that returns, do
the full backup.

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

No, how an IndexReader is opened on the index won't alter what
IndexWriter is doing to it.

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


Mime
View raw message