public abstract class FilteredTermsEnum extends TermsEnum
Term enumerations are always ordered by
getComparator(). Each term in the enumeration is
greater than all that precede it.
Please note: Consumers of this enum cannot
call seek(), it is forward only; it throws
UnsupportedOperationException when a seeking method
is called.
TermsEnum.SeekStatus| Constructor and Description |
|---|
FilteredTermsEnum(TermsEnum tenum)
Creates a filtered
TermsEnum on a terms enum. |
FilteredTermsEnum(TermsEnum tenum,
boolean startWithSeek)
Creates a filtered
TermsEnum on a terms enum. |
| Modifier and Type | Method and Description |
|---|---|
AttributeSource |
attributes()
Returns the related attributes, the returned
AttributeSource
is shared with the delegate TermsEnum. |
int |
docFreq()
Returns the number of documents containing the current
term.
|
DocsEnum |
docs(Bits bits,
DocsEnum reuse,
int flags)
Get
DocsEnum for the current term, with
control over whether freqs are required. |
DocsAndPositionsEnum |
docsAndPositions(Bits bits,
DocsAndPositionsEnum reuse,
int flags)
Get
DocsAndPositionsEnum for the current term,
with control over whether offsets and payloads are
required. |
java.util.Comparator<BytesRef> |
getComparator()
Return the
BytesRef Comparator used to sort terms provided by the
iterator. |
BytesRef |
next()
Increments the iteration to the next
BytesRef in the iterator. |
long |
ord()
Returns ordinal position for current term.
|
TermsEnum.SeekStatus |
seekCeil(BytesRef term)
This enum does not support seeking!
|
boolean |
seekExact(BytesRef term)
This enum does not support seeking!
|
void |
seekExact(BytesRef term,
TermState state)
This enum does not support seeking!
|
void |
seekExact(long ord)
This enum does not support seeking!
|
BytesRef |
term()
Returns current term.
|
TermState |
termState()
Returns the filtered enums term state
|
long |
totalTermFreq()
Returns the total number of occurrences of this term
across all documents (the sum of the freq() for each
doc that has this term).
|
docs, docsAndPositionspublic FilteredTermsEnum(TermsEnum tenum)
TermsEnum on a terms enum.tenum - the terms enumeration to filter.public AttributeSource attributes()
AttributeSource
is shared with the delegate TermsEnum.attributes in class TermsEnumpublic BytesRef term() throws java.io.IOException
TermsEnumpublic java.util.Comparator<BytesRef> getComparator()
BytesRefIteratorBytesRef Comparator used to sort terms provided by the
iterator. This may return null if there are no items or the iterator is not
sorted. Callers may invoke this method many times, so it's best to cache a
single instance & reuse it.public int docFreq()
throws java.io.IOException
TermsEnumTermsEnum.SeekStatus.END.public long totalTermFreq()
throws java.io.IOException
TermsEnumtotalTermFreq in class TermsEnumjava.io.IOExceptionpublic boolean seekExact(BytesRef term) throws java.io.IOException
public TermsEnum.SeekStatus seekCeil(BytesRef term) throws java.io.IOException
public void seekExact(long ord)
throws java.io.IOException
public long ord()
throws java.io.IOException
TermsEnumUnsupportedOperationException). Do not call this
when the enum is unpositioned.public DocsEnum docs(Bits bits, DocsEnum reuse, int flags) throws java.io.IOException
TermsEnumDocsEnum for the current term, with
control over whether freqs are required. Do not
call this when the enum is unpositioned. This method
will not return null.docs in class TermsEnumbits - unset bits are documents that should not
be returnedreuse - pass a prior DocsEnum for possible reuseflags - specifies which optional per-document values
you require; see DocsEnum.FLAG_FREQSjava.io.IOExceptionTermsEnum.docs(Bits, DocsEnum, int)public DocsAndPositionsEnum docsAndPositions(Bits bits, DocsAndPositionsEnum reuse, int flags) throws java.io.IOException
TermsEnumDocsAndPositionsEnum for the current term,
with control over whether offsets and payloads are
required. Some codecs may be able to optimize their
implementation when offsets and/or payloads are not required.
Do not call this when the enum is unpositioned. This
will return null if positions were not indexed.docsAndPositions in class TermsEnumbits - unset bits are documents that should not
be returnedreuse - pass a prior DocsAndPositionsEnum for possible reuseflags - specifies which optional per-position values you
require; see DocsAndPositionsEnum.FLAG_OFFSETS and
DocsAndPositionsEnum.FLAG_PAYLOADS.java.io.IOExceptionpublic void seekExact(BytesRef term, TermState state) throws java.io.IOException
public TermState termState() throws java.io.IOException
termState in class TermsEnumjava.io.IOExceptionTermState,
TermsEnum.seekExact(BytesRef, TermState)public BytesRef next() throws java.io.IOException
BytesRefIteratorBytesRef in the iterator.
Returns the resulting BytesRef or null if the end of
the iterator is reached. The returned BytesRef may be re-used across calls
to next. After this method returns null, do not call it again: the results
are undefined.BytesRef in the iterator or null if
the end of the iterator is reached.java.io.IOException - If there is a low-level I/O error.Copyright © 2010 - 2024 Adobe. All Rights Reserved