Skip to content

Apache Lucene open-source search software

LUCENE-5690: MultiTerms should expose sub-Terms

Yonik Seeley297f06ecb426
diff --git a/lucene/core/src/java/org/apache/lucene/index/MultiTerms.java b/lucene/core/src/java/org/apache/lucene/index/MultiTerms.java
index 85ef653be19..2ad32de2170 100644
--- a/lucene/core/src/java/org/apache/lucene/index/MultiTerms.java
+++ b/lucene/core/src/java/org/apache/lucene/index/MultiTerms.java
@@ -68,6 +68,16 @@ public final class MultiTerms extends Terms {
hasPayloads = hasPositions && _hasPayloads; // if all subs have pos, and at least one has payloads.
}
+ /** Expert: returns the Terms being merged. */
+ public Terms[] getSubTerms() {
+ return subs;
+ }
+
+ /** Expert: returns pointers to the sub-readers corresponding to the Terms being merged. */
+ public ReaderSlice[] getSubSlices() {
+ return subSlices;
+ }
+
@Override
public TermsEnum intersect(CompiledAutomaton compiled, BytesRef startTerm) throws IOException {
final List<MultiTermsEnum.TermsEnumIndex> termsEnums = new ArrayList<>();