Package org.apache.lucene.codecs.memory
Class FSTOrdTermsReader.TermsReader.SegmentTermsEnum
- java.lang.Object
-
- org.apache.lucene.index.TermsEnum
-
- org.apache.lucene.index.BaseTermsEnum
-
- org.apache.lucene.codecs.memory.FSTOrdTermsReader.TermsReader.BaseTermsEnum
-
- org.apache.lucene.codecs.memory.FSTOrdTermsReader.TermsReader.SegmentTermsEnum
-
- All Implemented Interfaces:
BytesRefIterator
- Enclosing class:
- FSTOrdTermsReader.TermsReader
private final class FSTOrdTermsReader.TermsReader.SegmentTermsEnum extends FSTOrdTermsReader.TermsReader.BaseTermsEnum
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.lucene.index.TermsEnum
TermsEnum.SeekStatus
-
-
Field Summary
Fields Modifier and Type Field Description (package private) boolean
decoded
(package private) BytesRefFSTEnum<java.lang.Long>
fstEnum
(package private) boolean
seekPending
(package private) BytesRef
term
-
Fields inherited from class org.apache.lucene.codecs.memory.FSTOrdTermsReader.TermsReader.BaseTermsEnum
bytesLength, bytesStart, docFreq, longs, metaBlockOrd, metaBytesReader, metaLongsReader, ord, state, statsBlockOrd, statsReader, totalTermFreq
-
-
Constructor Summary
Constructors Constructor Description SegmentTermsEnum()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
decodeMetaData()
Let PBF decode metadataBytesRef
next()
Increments the iteration to the nextBytesRef
in the iterator.TermsEnum.SeekStatus
seekCeil(BytesRef target)
Seeks to the specified term, if it exists, or to the next (ceiling) term.boolean
seekExact(BytesRef target)
Attempts to seek to the exact term, returning true if the term is found.void
seekExact(BytesRef target, TermState otherState)
Expert: Seeks a specific position byTermState
previously obtained fromTermsEnum.termState()
.BytesRef
term()
Returns current term.(package private) void
updateEnum(BytesRefFSTEnum.InputOutput<java.lang.Long> pair)
-
Methods inherited from class org.apache.lucene.codecs.memory.FSTOrdTermsReader.TermsReader.BaseTermsEnum
decodeStats, docFreq, impacts, ord, postings, refillMetadata, refillStats, seekExact, termState, totalTermFreq
-
Methods inherited from class org.apache.lucene.index.BaseTermsEnum
attributes
-
-
-
-
Field Detail
-
fstEnum
final BytesRefFSTEnum<java.lang.Long> fstEnum
-
term
BytesRef term
-
decoded
boolean decoded
-
seekPending
boolean seekPending
-
-
Method Detail
-
term
public BytesRef term() throws java.io.IOException
Description copied from class:TermsEnum
Returns current term. Do not call this when the enum is unpositioned.
-
decodeMetaData
void decodeMetaData() throws java.io.IOException
Description copied from class:FSTOrdTermsReader.TermsReader.BaseTermsEnum
Let PBF decode metadata- Overrides:
decodeMetaData
in classFSTOrdTermsReader.TermsReader.BaseTermsEnum
- Throws:
java.io.IOException
-
updateEnum
void updateEnum(BytesRefFSTEnum.InputOutput<java.lang.Long> pair) throws java.io.IOException
- Throws:
java.io.IOException
-
next
public BytesRef next() throws java.io.IOException
Description copied from interface:BytesRefIterator
Increments the iteration to the nextBytesRef
in the iterator. Returns the resultingBytesRef
ornull
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 ornull
if the end of the iterator is reached. - Throws:
java.io.IOException
- If there is a low-level I/O error.
-
seekExact
public boolean seekExact(BytesRef target) throws java.io.IOException
Description copied from class:TermsEnum
Attempts to seek to the exact term, returning true if the term is found. If this returns false, the enum is unpositioned. For some codecs, seekExact may be substantially faster thanTermsEnum.seekCeil(org.apache.lucene.util.BytesRef)
.- Overrides:
seekExact
in classBaseTermsEnum
- Returns:
- true if the term is found; return false if the enum is unpositioned.
- Throws:
java.io.IOException
-
seekCeil
public TermsEnum.SeekStatus seekCeil(BytesRef target) throws java.io.IOException
Description copied from class:TermsEnum
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
public void seekExact(BytesRef target, TermState otherState)
Description copied from class:TermsEnum
Expert: Seeks a specific position byTermState
previously obtained fromTermsEnum.termState()
. Callers should maintain theTermState
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 state was obtained from the sameTermsEnum
instance.NOTE: Using this method with an incompatible
TermState
might leave thisTermsEnum
in undefined state. On a segment levelTermState
instances are compatible only iff the source and the targetTermsEnum
operate on the same field. If operating on segment level, TermState instances must not be used across segments.NOTE: A seek by
TermState
might not restore theAttributeSource
's state.AttributeSource
states must be maintained separately if this method is used.- Overrides:
seekExact
in classBaseTermsEnum
- Parameters:
target
- the term the TermState corresponds tootherState
- theTermState
-
-