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

Michael McCandless commented on LUCENE-3606:
--------------------------------------------

I appreciate the purity of a truly read-only IndexReader, but there
are things deleting from IR can do that IW cannot:

  * Real-time deletes: you can delete from IR and have it take
    immediate effect on a searcher using that IR.  With IW you have to
    do an NRT reopen instead.

  * Delete by docID... users seem to use/want this (eg ask from time
    to time if we can do this in IW, which we can't since merging can
    shift docIDs at any time).

  * IR tells you how many documents were affected by a delete-by-Term.
    IW cannot, since it buffers and only resolves all deletes in bulk
    later.

Now... just because IR can do these things that IW cannot.... doesn't
mean they are compelling / important.  Ie maybe no app out there
relies on these special things and so we can lose this functionality?
I'm not sure...

On removing IR.setNorm, I agree we should just remove it: in trunk now
you can make a custom sim that boost norms "live", so we won't lose
any functionality.  The setNorm code (and the implications -- all the
per-field normGen, reference counting, scary SR.reopen, etc.) is truly
hairy; would be great to nuke it all.

                
> Make IndexReader really read-only in Lucene 4.0
> -----------------------------------------------
>
>                 Key: LUCENE-3606
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3606
>             Project: Lucene - Java
>          Issue Type: Task
>          Components: core/index
>    Affects Versions: 4.0
>            Reporter: Uwe Schindler
>
> As we change API completely in Lucene 4.0 we are also free to remove 
> read-write access and commits from IndexReader. This code is so hairy and 
> buggy (as investigated by Robert and Mike today) when you work on 
> SegmentReader level but forget to flush in the DirectoryReader, so its better 
> to really make IndexReaders readonly.
> Currently with IndexReader you can do things like:
> - delete/undelete Documents -> Can be done by with IndexWriter, too (using 
> deleteByQuery)
> - change norms -> this is a bad idea in general, but when we remove norms at 
> all and replace by DocValues this is obsolete already. Changing DocValues 
> should also be done using IndexWriter in trunk (once it is ready)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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