DirectoryReader.listCommits is what you are looking for! Mike McCandless
http://blog.mikemccandless.com On Tue, Sep 5, 2017 at 4:22 PM, Bryan Bende <bbe...@gmail.com> wrote: > 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-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org > >