Class DocumentDictionary.DocumentInputEnumerator
Implements IInputEnumerator from stored fields.
Inherited Members
Namespace: Lucene.Net.Search.Suggest
Assembly: Lucene.Net.Suggest.dll
Syntax
protected class DocumentDictionary.DocumentInputEnumerator : IInputEnumerator, IBytesRefEnumerator
Constructors
DocumentInputEnumerator(DocumentDictionary, bool, bool)
Creates an iterator over term, weight and payload fields from the lucene
index. Setting hasPayloads
to false
, implies an enumerator
over only term and weight.
Declaration
public DocumentInputEnumerator(DocumentDictionary documentDictionary, bool hasPayloads, bool hasContexts)
Parameters
Type | Name | Description |
---|---|---|
DocumentDictionary | documentDictionary | |
bool | hasPayloads | |
bool | hasContexts |
Properties
Comparer
Return the Lucene.Net.Util.BytesRef Comparer 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.
Declaration
public virtual IComparer<BytesRef> Comparer { get; }
Property Value
Type | Description |
---|---|
IComparer<BytesRef> |
Contexts
A term's contexts context can be used to filter suggestions. May return null, if suggest entries do not have any context
Declaration
public virtual ICollection<BytesRef> Contexts { get; }
Property Value
Type | Description |
---|---|
ICollection<BytesRef> |
Current
Gets the Lucene.Net.Util.BytesRef for the current iteration. The returned Lucene.Net.Util.BytesRef may be reused across calls to Lucene.Net.Util.IBytesRefEnumerator.MoveNext().
Declaration
public BytesRef Current { get; }
Property Value
Type | Description |
---|---|
BytesRef |
HasContexts
Returns true if the iterator has contexts
Declaration
public virtual bool HasContexts { get; }
Property Value
Type | Description |
---|---|
bool |
HasPayloads
Returns true if the iterator has payloads
Declaration
public virtual bool HasPayloads { get; }
Property Value
Type | Description |
---|---|
bool |
Payload
An arbitrary byte[] to record per suggestion. See Payload to retrieve the payload for each suggestion.
Declaration
public virtual BytesRef Payload { get; }
Property Value
Type | Description |
---|---|
BytesRef |
Weight
A term's weight, higher numbers mean better suggestions.
Declaration
public virtual long Weight { get; }
Property Value
Type | Description |
---|---|
long |
Methods
GetWeight(Document, int)
Returns the value of the Weight property for the current document.
Retrieves the value for the Weight property if its stored (using doc
)
or if its indexed as Lucene.Net.Index.NumericDocValues (using docId
) for the document.
If no value is found, then the weight is 0.
Declaration
protected virtual long GetWeight(Document doc, int docId)
Parameters
Type | Name | Description |
---|---|---|
Document | doc | |
int | docId |
Returns
Type | Description |
---|---|
long |
MoveNext()
Increments the iteration to the next Lucene.Net.Util.BytesRef in the enumerator.
Declaration
public bool MoveNext()
Returns
Type | Description |
---|---|
bool |
|
Exceptions
Type | Condition |
---|---|
IOException | If there is a low-level I/O error. |