- java.lang.Object
-
- org.apache.lucene.index.TermsEnum
-
- org.apache.lucene.index.FilteredTermsEnum
-
- org.apache.lucene.search.join.SeekingTermSetTermsEnum
-
- All Implemented Interfaces:
BytesRefIterator
public class SeekingTermSetTermsEnum extends FilteredTermsEnum
A filtered TermsEnum that uses a BytesRefHash as a filter
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.lucene.index.FilteredTermsEnum
FilteredTermsEnum.AcceptStatus
-
Nested classes/interfaces inherited from class org.apache.lucene.index.TermsEnum
TermsEnum.SeekStatus
-
-
Field Summary
Fields Modifier and Type Field Description private int
lastElement
private BytesRef
lastTerm
private int[]
ords
private BytesRef
seekTerm
private BytesRef
spare
private BytesRefHash
terms
private int
upto
-
Fields inherited from class org.apache.lucene.index.FilteredTermsEnum
actualTerm, tenum
-
-
Constructor Summary
Constructors Constructor Description SeekingTermSetTermsEnum(TermsEnum tenum, BytesRefHash terms, int[] ords)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 toFilteredTermsEnum.next()
or ifFilteredTermsEnum.accept(org.apache.lucene.util.BytesRef)
returnsFilteredTermsEnum.AcceptStatus.YES_AND_SEEK
orFilteredTermsEnum.AcceptStatus.NO_AND_SEEK
, this method will be called to eventually seek the underlying TermsEnum to a new position.-
Methods inherited from class org.apache.lucene.index.FilteredTermsEnum
attributes, docFreq, impacts, next, ord, postings, seekCeil, seekExact, seekExact, seekExact, setInitialSeekTerm, term, termState, totalTermFreq
-
-
-
-
Field Detail
-
terms
private final BytesRefHash terms
-
ords
private final int[] ords
-
lastElement
private final int lastElement
-
lastTerm
private final BytesRef lastTerm
-
spare
private final BytesRef spare
-
seekTerm
private BytesRef seekTerm
-
upto
private int upto
-
-
Constructor Detail
-
SeekingTermSetTermsEnum
public SeekingTermSetTermsEnum(TermsEnum tenum, BytesRefHash terms, int[] ords)
Constructor
-
-
Method Detail
-
nextSeekTerm
protected BytesRef nextSeekTerm(BytesRef currentTerm) throws java.io.IOException
Description copied from class:FilteredTermsEnum
On the first call toFilteredTermsEnum.next()
or ifFilteredTermsEnum.accept(org.apache.lucene.util.BytesRef)
returnsFilteredTermsEnum.AcceptStatus.YES_AND_SEEK
orFilteredTermsEnum.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 benull
, 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 thennull
, 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.
- Overrides:
nextSeekTerm
in classFilteredTermsEnum
- Throws:
java.io.IOException
-
accept
protected FilteredTermsEnum.AcceptStatus accept(BytesRef term) throws java.io.IOException
Description copied from class:FilteredTermsEnum
Return if term is accepted, not accepted or the iteration should ended (and possibly seek).- Specified by:
accept
in classFilteredTermsEnum
- Throws:
java.io.IOException
-
-