lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Willnauer <simon.willna...@googlemail.com>
Subject Re: getting the number of updated documents
Date Thu, 10 Mar 2011 19:48:35 GMT
hey Koji,

2011/3/10 Koji Sekiguchi <koji@r.email.ne.jp>:
> Hello,
>
> Does IndexWriter (or somewhere else) have the method such that
> it gets the number of updated documents before commit?
you have maxDocs which gives you the maxdocid-1 but this might not be
super accurate since there might have been merges going on in the
background. I am not sure if this number you are asking for will
really help you with what you are trying todo.
If you want to rollback to your previous version why don't you keep
that commit point around and just open it again if something goes
wrong. You can specify a DeletionPolicy that keeps your opimized index
around until you nuke it in the case everything goes ok?

simon
>
> I have an optimized index and I'm using iw.updateDocument(Term,Document)
> with the index, and before commit, I'd like to know the number of updated
> documents from IndexWriter so that I can rollback if something goes wrong.
>
> Any ideas?
>
> Thanks,
>
> Koji
> --
> http://www.rondhuit.com/en/
>
> ---------------------------------------------------------------------
> 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