private final class LegacyNumericRangeQuery.NumericRangeTermsEnum extends FilteredTermsEnum
WARNING: This term enumeration is not guaranteed to be always ordered by
Term.compareTo(org.apache.lucene.index.Term)
.
The ordering depends on how LegacyNumericUtils.splitLongRange(org.apache.lucene.util.LegacyNumericUtils.LongRangeBuilder, int, long, long)
and
LegacyNumericUtils.splitIntRange(org.apache.lucene.util.LegacyNumericUtils.IntRangeBuilder, int, int, int)
generates the sub-ranges. For
MultiTermQuery
ordering is not relevant.
FilteredTermsEnum.AcceptStatus
TermsEnum.SeekStatus
Modifier and Type | Field and Description |
---|---|
private BytesRef |
currentLowerBound |
private BytesRef |
currentUpperBound |
private java.util.LinkedList<BytesRef> |
rangeBounds |
actualTerm, tenum
Constructor and Description |
---|
NumericRangeTermsEnum(TermsEnum tenum) |
Modifier and Type | Method and Description |
---|---|
protected FilteredTermsEnum.AcceptStatus |
accept(BytesRef term)
Return if term is accepted, not accepted or the iteration should ended
(and possibly seek).
|
private void |
nextRange() |
protected BytesRef |
nextSeekTerm(BytesRef term)
On the first call to
FilteredTermsEnum.next() or if FilteredTermsEnum.accept(org.apache.lucene.util.BytesRef) returns
FilteredTermsEnum.AcceptStatus.YES_AND_SEEK or FilteredTermsEnum.AcceptStatus.NO_AND_SEEK ,
this method will be called to eventually seek the underlying TermsEnum
to a new position. |
attributes, docFreq, next, ord, postings, seekCeil, seekExact, seekExact, seekExact, setInitialSeekTerm, term, termState, totalTermFreq
private BytesRef currentLowerBound
private BytesRef currentUpperBound
private final java.util.LinkedList<BytesRef> rangeBounds
NumericRangeTermsEnum(TermsEnum tenum)
private void nextRange()
protected final BytesRef nextSeekTerm(BytesRef term)
FilteredTermsEnum
FilteredTermsEnum.next()
or if FilteredTermsEnum.accept(org.apache.lucene.util.BytesRef)
returns
FilteredTermsEnum.AcceptStatus.YES_AND_SEEK
or FilteredTermsEnum.AcceptStatus.NO_AND_SEEK
,
this method will be called to eventually seek the underlying TermsEnum
to a new position.
On the first call, currentTerm
will be null
, later
calls will provide the term the underlying enum is positioned at.
This method returns per default only one time the initial seek term
and then null
, so no repositioning is ever done.
Override this method, if you want a more sophisticated TermsEnum,
that repositions the iterator during enumeration.
If this method always returns null
the enum is empty.
Please note: This method should always provide a greater term than the last enumerated term, else the behaviour of this enum violates the contract for TermsEnums.
nextSeekTerm
in class FilteredTermsEnum
protected final FilteredTermsEnum.AcceptStatus accept(BytesRef term)
FilteredTermsEnum
accept
in class FilteredTermsEnum