[
https://issues.apache.org/jira/browse/LUCENE-4575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13508267#comment-13508267
]
Michael McCandless commented on LUCENE-4575:
--------------------------------------------
{quote}
I agree that calling that setCommitData in finishCommit is redundant, but
perhaps we can solve it more elegantly by either:
# Not storing the setCommitData in infos, but rather in a private IW member.
Then in startCommit set it on the cloned infos. It's essentially how it's done
today, only now the commit data will be copied from a member.
# Stick w/ current API commit(commitData) and prepareCommit(commitData), and
just make sure that commit goes through even if changeCount ==
previousChangeCount, but commitUserData != null.
{quote}
Hmm, I'd rather not store the member inside IW *and* inside SIS; just seems
safer to have a single clear place where this is tracked.
Also, I like the new API so I'd rather not do #2?
I think just removing that line in finishCommit should fix the bug ... but
first we need a test exposing it.
bq. I think that the code in finishCommit ensures that we can always pull the
commitData from segmentInfos?
Yes.
> Allow IndexWriter to commit, even just commitData
> -------------------------------------------------
>
> Key: LUCENE-4575
> URL: https://issues.apache.org/jira/browse/LUCENE-4575
> Project: Lucene - Core
> Issue Type: Improvement
> Components: core/index
> Reporter: Shai Erera
> Priority: Minor
> Attachments: LUCENE-4575.patch, LUCENE-4575.patch
>
>
> Spinoff from here
> http://lucene.472066.n3.nabble.com/commit-with-only-commitData-td4022155.html.
> In some cases, it is valuable to be able to commit changes to the index, even
> if the changes are just commitData. Such data is sometimes used by
> applications to register in the index some global application
> information/state.
> The proposal is:
> * Add a setCommitData() API and separate it from commit() and prepareCommit()
> (simplify their API)
> * When that API is called, flip on the dirty/changes bit, so that this gets
> committed even if no other changes were made to the index.
> I will work on a patch a post.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]