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: Open IndexWriter to prior commit
Date Tue, 05 Sep 2017 20:53:13 GMT
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 <bbende@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-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message