LUCENE-3918: Make SortingTerms.intersect return mapped docs enums.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1460165 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Adrien Grand 2013-03-23 14:44:38 +00:00
parent aba19484b9
commit 258fc9f41a
1 changed files with 7 additions and 0 deletions
lucene/misc/src/java/org/apache/lucene/index/sorter

View File

@ -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 FilterAtomicReader {
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 {