Method SeekExact
SeekExact(BytesRef)
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(BytesRef) may
be substantially faster than SeekCeil(BytesRef).
Declaration
public virtual bool SeekExact(BytesRef text)
Parameters
Type | Name | Description |
---|---|---|
BytesRef | text |
Returns
Type | Description |
---|---|
System.Boolean |
SeekExact(Int64)
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.
Declaration
public abstract void SeekExact(long ord)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | ord |
SeekExact(BytesRef, TermState)
Expert: Seeks a specific position by TermState previously obtained from GetTermState(). 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 state was obtained from the same TermsEnum instance.
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.
NOTE: A seek by TermState might not restore the AttributeSource's state. AttributeSource states must be maintained separately if this method is used.
Declaration
public virtual void SeekExact(BytesRef term, TermState state)
Parameters
Type | Name | Description |
---|---|---|
BytesRef | term | the term the TermState corresponds to |
TermState | state | the TermState |