lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bryan Bende <bbe...@gmail.com>
Subject Open IndexWriter to prior commit
Date Tue, 05 Sep 2017 20:22:24 GMT
I was reading this blog post about Lucene transactions (thank you to
Mike for writing this):
http://blog.mikemccandless.com/2012/03/transactional-lucene.html

I'm interested in the part that references distributed transactions and says:

"if Lucene completed its 2nd phase commit but the database's 2nd phase
hit some error or crash or power loss, you can easily rollback
Lucene's commit by opening an IndexWriter on the prior commit. "

I see that you can pass in an IndexWriterConfig with an IndexCommit
which will tell the IndexWriter where to open from...

What is the best way to get access to the prior IndexCommit?

It looks like you could open a StandardDirectoryReader and then call
getIndexCommit(), but I wasn't sure if there was a better or easier
way using some information that is already in the existing
IndexWriter.

Thanks,

Bryan

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