A base TermsEnum that adds default implementations for
#attributes()
#termState()
#seekExact(BytesRef)
#seekExact(BytesRef, TermState)
prepareSeekExact(org.apache.lucene.util.BytesRef text)| field | type | note |
|---|---|---|
| EMPTY | BytesRefIterator | Singleton BytesRefIterator that iterates over 0 BytesRefs. |
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.
| IOException | If there is a low-level I/O error. | |
docFreq()Returns the number of documents containing the current term. Do not call this when the enum is
unpositioned. SeekStatus#END.
ord()Returns ordinal position for current term. This is an optional method (the codec may throw
UnsupportedOperationException). Do not call this when the enum is unpositioned.
postings(org.apache.lucene.index.PostingsEnum reuse)Get PostingsEnum for the current term. Do not call this when the enum is unpositioned.
This method will not return null.
NOTE: the returned iterator may return deleted documents, so deleted documents have
to be checked on top of the PostingsEnum.
Use this method if you only require documents and frequencies, and do not need any proximity
data. This method is equivalent to postings(reuse,
PostingsEnum.FREQS)
| name | type | description |
|---|---|---|
| reuse | org.apache.lucene.index.PostingsEnum | pass a prior PostingsEnum for possible reuse |
postings(org.apache.lucene.index.PostingsEnum reuse, int flags)Get PostingsEnum for the current term, with control over whether freqs, positions,
offsets or payloads are required. Do not call this when the enum is unpositioned. This method
will not return null.
NOTE: the returned iterator may return deleted documents, so deleted documents have
to be checked on top of the PostingsEnum.
| name | type | description |
|---|---|---|
| reuse | org.apache.lucene.index.PostingsEnum | pass a prior PostingsEnum for possible reuse |
| flags | int | specifies which optional per-document values you require; see PostingsEnum#FREQS |
seekCeil(org.apache.lucene.util.BytesRef text)Seeks to the specified term, if it exists, or to the next (ceiling) term. Returns SeekStatus to indicate whether exact term was found, a different term was found, or EOF was hit. The target term may be before or after the current term. If this returns SeekStatus.END, the enum is unpositioned.
seekExact(long ord)Seeks to the specified term by ordinal (position) as previously returned by #ord. The
target ord may be before or after the current ord, and must be within bounds.
Returns current term. Do not call this when the enum is unpositioned.
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). Note that, like other term measures, this measure does not take deleted documents into account.