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

Shai Erera commented on LUCENE-5871:
------------------------------------

I don't think this patch is correct. IndexWriter uses Version not in order to 
commitOnClose, but to throw an exception if you have uncommitted changes. You 
see, IndexWriter.close() *no longer commits* in trunk, it always discards 
uncommitted changes. The only difference is whether they are discarded silently 
or loudly.

That's why I said that this code should be either removed or deprecated in 5.0 
and removed in 6.0. The only reason this code exists is that we want people who 
migrate from 4.x to 5.0 will not silently break their app if they didn't call 
commit() prior to close() (or called shutdown()). But I'm not sure these users 
will know to pass Version < 5.0 in order to set that behavior, unless they 
already do.

Anyway, if we want to make this patch valid, we should name the setter 
something like setFailIfUncommittedChangesOnClose ...

> Simplify or remove use of Version in IndexWriterConfig
> ------------------------------------------------------
>
>                 Key: LUCENE-5871
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5871
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Ryan Ernst
>         Attachments: LUCENE-5871.patch
>
>
> {{IndexWriter}} currently uses Version from {{IndexWriterConfig}} to 
> determine the semantics of {{close()}}.  This is a trapdoor for users, as 
> they often default to just sending Version.LUCENE_CURRENT since they don't 
> understand what it will be used for.  Instead, we should make the semantics 
> of close a direction option in IWC.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to