lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nikolay Zamosenchuk <>
Subject IndexReader.getSequentialSubReaders() usage in Lucene 2.9+
Date Thu, 27 May 2010 09:00:21 GMT
Hi, Dear colleagues!
I have one question concerning IndexReader.getSequentialSubReaders()
and it's usage.

Imagine there is a class extending DirectoryReader or MultiReader.
Usually directory- or multi-reader consists of sub-readers (i.e.
segment-readers). Is it safe enough to return always null in
IndexReader.getSequentialSubReaders() ?

We have a special Query and Weight classes that relies on custom
extended IndexReader. If this method (getSequentialSubReaders) is not
overridden, then our Weight class receives ReadOnlySegmentReader
I found that method changed in lucene
2.4.1->2.9.2, so subReaders are passed instead of original reader.
I've also found, that returning null in
IndexReader.getSequentialSubReaders() will avoid usage of subReaders.
Seems returning the null helped and tests pessed.
But there is a question, is it safe enough to return null in
IndexReader.getSequentialSubReaders() ? Would it break some internal

Thanks much!
Best regards, Nikolay Zamosenchuk
eXo (UA)

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

View raw message