Hi Adrien: I think this may hint at a larger problem? intersect() is an optional method with a default implementation that works over iterator(). This is similar to other optional methods like seekExact() on FilteredTermsEnum (it has a default impl in TermsEnum which calls seekCeil).
is it really good that FilteredTerms/FilteredTermsEnum delegate these optional methods by default? On Sat, Mar 23, 2013 at 10:44 AM, <[email protected]> wrote: > Author: jpountz > Date: Sat Mar 23 14:44:38 2013 > New Revision: 1460165 > > URL: http://svn.apache.org/r1460165 > Log: > LUCENE-3918: Make SortingTerms.intersect return mapped docs enums. > > Modified: > > lucene/dev/trunk/lucene/misc/src/java/org/apache/lucene/index/sorter/SortingAtomicReader.java > > Modified: > lucene/dev/trunk/lucene/misc/src/java/org/apache/lucene/index/sorter/SortingAtomicReader.java > URL: > http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/misc/src/java/org/apache/lucene/index/sorter/SortingAtomicReader.java?rev=1460165&r1=1460164&r2=1460165&view=diff > ============================================================================== > --- > lucene/dev/trunk/lucene/misc/src/java/org/apache/lucene/index/sorter/SortingAtomicReader.java > (original) > +++ > lucene/dev/trunk/lucene/misc/src/java/org/apache/lucene/index/sorter/SortingAtomicReader.java > Sat Mar 23 14:44:38 2013 > @@ -44,6 +44,7 @@ import org.apache.lucene.util.ArrayUtil; > import org.apache.lucene.util.Bits; > import org.apache.lucene.util.BytesRef; > import org.apache.lucene.util.SorterTemplate; > +import org.apache.lucene.util.automaton.CompiledAutomaton; > > /** > * An {@link AtomicReader} which supports sorting documents by a given > @@ -102,6 +103,12 @@ public class SortingAtomicReader extends > return new SortingTermsEnum(in.iterator(reuse), docMap, indexOptions); > } > > + @Override > + public TermsEnum intersect(CompiledAutomaton compiled, BytesRef > startTerm) > + throws IOException { > + return new SortingTermsEnum(in.intersect(compiled, startTerm), docMap, > indexOptions); > + } > + > } > > private static class SortingTermsEnum extends FilterTermsEnum { > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
