public class SeekingTermSetTermsEnum extends FilteredTermsEnum
FilteredTermsEnum.AcceptStatus
TermsEnum.SeekStatus
Modifier and Type | Field and Description |
---|---|
private int |
lastElement |
private BytesRef |
lastTerm |
private int[] |
ords |
private BytesRef |
seekTerm |
private BytesRef |
spare |
private BytesRefHash |
terms |
private int |
upto |
actualTerm, tenum
Constructor and Description |
---|
SeekingTermSetTermsEnum(TermsEnum tenum,
BytesRefHash terms,
int[] ords)
Constructor
|
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).
|
protected BytesRef |
nextSeekTerm(BytesRef currentTerm)
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, impacts, next, ord, postings, seekCeil, seekExact, seekExact, seekExact, setInitialSeekTerm, term, termState, totalTermFreq
private final BytesRefHash terms
private final int[] ords
private final int lastElement
private final BytesRef lastTerm
private final BytesRef spare
private BytesRef seekTerm
private int upto
public SeekingTermSetTermsEnum(TermsEnum tenum, BytesRefHash terms, int[] ords)
protected BytesRef nextSeekTerm(BytesRef currentTerm) throws java.io.IOException
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
java.io.IOException
protected FilteredTermsEnum.AcceptStatus accept(BytesRef term) throws java.io.IOException
FilteredTermsEnum
accept
in class FilteredTermsEnum
java.io.IOException