lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler (JIRA)" <>
Subject [jira] [Commented] (LUCENE-4152) add one-syllable method to IndexReader enumerate subreaders
Date Mon, 18 Jun 2012 11:59:42 GMT


Uwe Schindler commented on LUCENE-4152:

bq. They also have tricky semantics (e.g. returning null).

No longer since January's refactoring, leaves() returns always something != null. And getSeqSubReaders
is only available on CompositeReaders, which always have subReaders. See the other issue LUCENE-3866
where I did some more refactoring to make all this easier.

In general I agree with that, as leaves() and children()/subs() would then just be a shortcut
to getTopReaderContext()'s methods (leaves(), children() - both are Iterable, no need to change
anything) (I would rename that one to as[Top]Context()).

Returning plain subReaders without Contexts is not really useful, as all of Lucene's Query
logic uses AtomicReaderContext, so leaves() on IndexReader returning the same as getTopReaderContext().leaves()
is the way to go. This method can be added as final "easy-use method". I hope you look at
my other patch @ LUCENE-3866, because it shows how simple the code is now without ReaderUtil.Gather.
> add one-syllable method to IndexReader enumerate subreaders
> -----------------------------------------------------------
>                 Key: LUCENE-4152
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>            Reporter: Robert Muir
>            Priority: Blocker
>             Fix For: 4.0
> Description is exactly as written.
> getSequentialSubReaders/getTopLevelReaderContext, these method names are way too long/unuseable.
They also have tricky semantics (e.g. returning null).
> In lucene 4, people cannot just use any indexreader and get a merged view. So we need
to make this stuff easy on them:
> * single-syllable method name (leaves(), subs(), i will think on this)
> * supports enhanced for-loop (no returning null or anything like that)
> * on indexreader (not atomic or composite, plain old indexreader)

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message