next

Increments the iteration to the next BytesRef 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.

Returns:

the next BytesRef in the iterator or null if
the end of the iterator is reached.

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). This will be -1 if the
codec doesn't support this measure. Note that, like
other term measures, this measure does not take
deleted documents into account.

docsAndPositions

Get DocsAndPositionsEnum 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.

seekExact

Expert: Seeks a specific position by TermState previously obtained
from TermsEnum.termState(). Callers should maintain the TermState to
use this method. Low-level implementations may position the TermsEnum
without re-seeking the term dictionary.

Seeking by TermState should only be used iff the enum the state was
obtained from and the enum the state is used for seeking are obtained from
the same IndexReader.

NOTE: Using this method with an incompatible TermState might leave
this TermsEnum in undefined state. On a segment level
TermState instances are compatible only iff the source and the
target TermsEnum operate on the same field. If operating on segment
level, TermState instances must not be used across segments.

getComparator

Return the BytesRef 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.