mirror of https://github.com/apache/lucene.git
LUCENE-970: FilterIndexReader now implements isOptimized().
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@561162 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f3b9c9407a
commit
4b11c35b08
|
@ -54,6 +54,9 @@ Bug fixes
|
|||
in case the index has multiple segments. The public MultiReader
|
||||
now extends MultiSegmentReader and is intended to be used by users
|
||||
who want to add their own subreaders. (Daniel Naber, Michael Busch)
|
||||
|
||||
8. LUCENE-970: FilterIndexReader now implements isOptimized(). Before
|
||||
a call of isOptimized() would throw a NPE. (Michael Busch)
|
||||
|
||||
New features
|
||||
|
||||
|
|
|
@ -217,4 +217,9 @@ public class FilterIndexReader extends IndexReader {
|
|||
ensureOpen();
|
||||
return in.isCurrent();
|
||||
}
|
||||
|
||||
public boolean isOptimized() {
|
||||
ensureOpen();
|
||||
return in.isOptimized();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -112,6 +112,8 @@ public class TestFilterIndexReader extends TestCase {
|
|||
|
||||
IndexReader reader = new TestReader(IndexReader.open(directory));
|
||||
|
||||
assertTrue(reader.isOptimized());
|
||||
|
||||
TermEnum terms = reader.terms();
|
||||
while (terms.next()) {
|
||||
assertTrue(terms.term().text().indexOf('e') != -1);
|
||||
|
|
Loading…
Reference in New Issue