[ 
https://issues.apache.org/jira/browse/LUCENE-4575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13508319#comment-13508319
 ] 

Shai Erera commented on LUCENE-4575:
------------------------------------

The test isn't exactly accurate, because it tests a scenario that is currently 
not supported. I.e., after calling prepareCommit(), nothing that you do on IW 
will be committed. Rather, to expose the bug it should be modified as follows:

{code}
iw.setCommitData(data1);
iw.prepareCommit();
iw.setCommitData(data2); // that will be ignored by follow-on commit
iw.commit();
checkCommitData(); // will see data1
iw.commit(); // that 'should' commit data2
checkCommitData(); // that will see data1 again, because of the copy that 
happens in finishCommit()
{code}

I'll modify the test like so and include it in my next patch.
                
> 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, 
> LUCENE-4575-testcase.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]

Reply via email to