Class TermsEnum
Iterator to seek (Seek
Term enumerations are always ordered by Comparer. Each term in the enumeration is greater than the one before it.
The TermsSeek
methods.
Inheritance
Implements
Namespace: Lucene.Net.Index
Assembly: Lucene.Net.dll
Syntax
public abstract class TermsEnum : object, IBytesRefIterator
Constructors
| Improve this Doc View SourceTermsEnum()
Sole constructor. (For invocation by subclass constructors, typically implicit.)
Declaration
protected TermsEnum()
Fields
| Improve this Doc View SourceEMPTY
An empty Terms
Please note: this enum should be unmodifiable, but it is currently possible to add Attributes to it. This should not be a problem, as the enum is always empty and the existence of unused Attributes does not matter.
Declaration
public static readonly TermsEnum EMPTY
Field Value
Type | Description |
---|---|
Terms |
Properties
| Improve this Doc View SourceAttributes
Returns the related attributes.
Declaration
public virtual AttributeSource Attributes { get; }
Property Value
Type | Description |
---|---|
Attribute |
Comparer
Declaration
public abstract IComparer<BytesRef> Comparer { get; }
Property Value
Type | Description |
---|---|
IComparer<Bytes |
DocFreq
Returns the number of documents containing the current term. Do not call this when the enum is unpositioned.
Declaration
public abstract int DocFreq { get; }
Property Value
Type | Description |
---|---|
System. |
See Also
| Improve this Doc View SourceOrd
Returns ordinal position for current term. This is an
optional property (the codec may throw
Declaration
public abstract long Ord { get; }
Property Value
Type | Description |
---|---|
System. |
Term
Returns current term. Do not call this when the enum is unpositioned.
Declaration
public abstract BytesRef Term { get; }
Property Value
Type | Description |
---|---|
Bytes |
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.
Declaration
public abstract long TotalTermFreq { get; }
Property Value
Type | Description |
---|---|
System. |
Methods
| Improve this Doc View SourceDocs(IBits, DocsEnum)
Get Docsnull
.
Declaration
public DocsEnum Docs(IBits liveDocs, DocsEnum reuse)
Parameters
Type | Name | Description |
---|---|---|
IBits | liveDocs | Unset bits are documents that should not be returned |
Docs |
reuse | Pass a prior Docs |
Returns
Type | Description |
---|---|
Docs |
Docs(IBits, DocsEnum, DocsFlags)
Get Docsnull
.
Declaration
public abstract DocsEnum Docs(IBits liveDocs, DocsEnum reuse, DocsFlags flags)
Parameters
Type | Name | Description |
---|---|---|
IBits | liveDocs | Unset bits are documents that should not be returned |
Docs |
reuse | Pass a prior DocsEnum for possible reuse |
Docs |
flags | Specifies which optional per-document values
you require; Docs |
Returns
Type | Description |
---|---|
Docs |
See Also
| Improve this Doc View SourceDocsAndPositions(IBits, DocsAndPositionsEnum)
Get Docsnull
if positions were not
indexed.
Declaration
public DocsAndPositionsEnum DocsAndPositions(IBits liveDocs, DocsAndPositionsEnum reuse)
Parameters
Type | Name | Description |
---|---|---|
IBits | liveDocs | Unset bits are documents that should not be returned |
Docs |
reuse | Pass a prior DocsAndPositionsEnum for possible reuse |
Returns
Type | Description |
---|---|
Docs |
See Also
| Improve this Doc View SourceDocsAndPositions(IBits, DocsAndPositionsEnum, DocsAndPositionsFlags)
Get Docsnull
if positions were not indexed.
Declaration
public abstract DocsAndPositionsEnum DocsAndPositions(IBits liveDocs, DocsAndPositionsEnum reuse, DocsAndPositionsFlags flags)
Parameters
Type | Name | Description |
---|---|---|
IBits | liveDocs | Unset bits are documents that should not be returned |
Docs |
reuse | Pass a prior DocsAndPositionsEnum for possible reuse |
Docs |
flags | Specifies which optional per-position values you
require; see Docs |
Returns
Type | Description |
---|---|
Docs |
GetTermState()
Expert: Returns the Terms
NOTE: A seek by Get
Declaration
public virtual TermState GetTermState()
Returns
Type | Description |
---|---|
Term |
See Also
| Improve this Doc View SourceNext()
Declaration
public abstract BytesRef Next()
Returns
Type | Description |
---|---|
Bytes |
SeekCeil(BytesRef)
Seeks to the specified term, if it exists, or to the
next (ceiling) term. Returns Terms
Declaration
public abstract TermsEnum.SeekStatus SeekCeil(BytesRef text)
Parameters
Type | Name | Description |
---|---|---|
Bytes |
text |
Returns
Type | Description |
---|---|
Terms |
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, Seek
Declaration
public virtual bool SeekExact(BytesRef text)
Parameters
Type | Name | Description |
---|---|---|
Bytes |
text |
Returns
Type | Description |
---|---|
System. |
SeekExact(BytesRef, TermState)
Expert: Seeks a specific position by Term
Seeking by Term
NOTE: Using this method with an incompatible Term
NOTE: A seek by Term
Declaration
public virtual void SeekExact(BytesRef term, TermState state)
Parameters
Type | Name | Description |
---|---|---|
Bytes |
term | the term the Term |
Term |
state | the Term |
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. |
ord |