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

robert engels commented on LUCENE-1475:
---------------------------------------

I think the API is wrong.

The method should either be

IndexReader[] getSubReaders()

It should return an empty array, not null when there are no sub readers.

But a better API is probably

IndexReader[] getReaders()

which contains an array containing itself if there are no sub-readers. The only 
drawback to this is if we allow multiple levels, then you need to make a check 
that this!=getReaders[0]

Using null adds null-checks in the common case.


> Expose sub-IndexReaders from MultiReader or MultiSegmentReader
> --------------------------------------------------------------
>
>                 Key: LUCENE-1475
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1475
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Index
>    Affects Versions: 2.4
>            Reporter: Jason Rutherglen
>            Priority: Minor
>         Attachments: LUCENE-1475.patch
>
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> MultiReader and MultiSegmentReader are package protected and do not expose 
> the underlying sub-IndexReaders.  A way to expose the sub-readers is to have 
> an interface that an IndexReader may be cast to that exposes the underlying 
> readers.  
> This is for realtime indexing.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to