Class DocValuesConsumer
Abstract API that consumes numeric, binary and sorted docvalues. Concrete implementations of this actually do "something" with the docvalues (write it into the index in a specific format).
The lifecycle is:
- DocValuesConsumer is created by FieldsConsumer(SegmentWriteState) or NormsConsumer(SegmentWriteState).
- AddNumericField(FieldInfo, IEnumerable<Nullable<Int64>>), AddBinaryField(FieldInfo, IEnumerable<BytesRef>), or AddSortedField(FieldInfo, IEnumerable<BytesRef>, IEnumerable<Nullable<Int64>>) are called for each Numeric, Binary, or Sorted docvalues field. The API is a "pull" rather than "push", and the implementation is free to iterate over the values multiple times (System.Collections.Generic.IEnumerable<T>.GetEnumerator()).
- After all fields are added, the consumer is Dispose()d.
Implements
Inherited Members
Namespace: Lucene.Net.Codecs
Assembly: Lucene.Net.dll
Syntax
public abstract class DocValuesConsumer : IDisposable
Constructors
| Improve this Doc View SourceDocValuesConsumer()
Sole constructor. (For invocation by subclass constructors, typically implicit.)
Declaration
protected DocValuesConsumer()
Methods
| Improve this Doc View SourceAddBinaryField(FieldInfo, IEnumerable<BytesRef>)
Writes binary docvalues for a field.
Declaration
public abstract void AddBinaryField(FieldInfo field, IEnumerable<BytesRef> values)
Parameters
Type | Name | Description |
---|---|---|
FieldInfo | field | Field information. |
System.Collections.Generic.IEnumerable<BytesRef> | values | System.Collections.Generic.IEnumerable<T> of binary values (one for each document). |
Exceptions
Type | Condition |
---|---|
System.IO.IOException | If an I/O error occurred. |
AddNumericField(FieldInfo, IEnumerable<Nullable<Int64>>)
Writes numeric docvalues for a field.
Declaration
public abstract void AddNumericField(FieldInfo field, IEnumerable<long?> values)
Parameters
Type | Name | Description |
---|---|---|
FieldInfo | field | Field information. |
System.Collections.Generic.IEnumerable<System.Nullable<System.Int64>> | values | System.Collections.Generic.IEnumerable<T> of numeric values (one for each document). |
Exceptions
Type | Condition |
---|---|
System.IO.IOException | If an I/O error occurred. |
AddSortedField(FieldInfo, IEnumerable<BytesRef>, IEnumerable<Nullable<Int64>>)
Writes pre-sorted binary docvalues for a field.
Declaration
public abstract void AddSortedField(FieldInfo field, IEnumerable<BytesRef> values, IEnumerable<long?> docToOrd)
Parameters
Type | Name | Description |
---|---|---|
FieldInfo | field | Field information. |
System.Collections.Generic.IEnumerable<BytesRef> | values | System.Collections.Generic.IEnumerable<T> of binary values in sorted order (deduplicated). |
System.Collections.Generic.IEnumerable<System.Nullable<System.Int64>> | docToOrd | System.Collections.Generic.IEnumerable<T> of ordinals (one for each document). |
Exceptions
Type | Condition |
---|---|
System.IO.IOException | If an I/O error occurred. |
AddSortedSetField(FieldInfo, IEnumerable<BytesRef>, IEnumerable<Nullable<Int64>>, IEnumerable<Nullable<Int64>>)
Writes pre-sorted set docvalues for a field
Declaration
public abstract void AddSortedSetField(FieldInfo field, IEnumerable<BytesRef> values, IEnumerable<long?> docToOrdCount, IEnumerable<long?> ords)
Parameters
Type | Name | Description |
---|---|---|
FieldInfo | field | Field information. |
System.Collections.Generic.IEnumerable<BytesRef> | values | System.Collections.Generic.IEnumerable<T> of binary values in sorted order (deduplicated). |
System.Collections.Generic.IEnumerable<System.Nullable<System.Int64>> | docToOrdCount | System.Collections.Generic.IEnumerable<T> of the number of values for each document. A zero ordinal count indicates a missing value. |
System.Collections.Generic.IEnumerable<System.Nullable<System.Int64>> | ords | System.Collections.Generic.IEnumerable<T> of ordinal occurrences ( |
Exceptions
Type | Condition |
---|---|
System.IO.IOException | If an I/O error occurred. |
Dispose()
Disposes all resources used by this object.
Declaration
public void Dispose()
Dispose(Boolean)
Implementations must override and should dispose all resources used by this instance.
Declaration
protected abstract void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
MergeBinaryField(FieldInfo, MergeState, IList<BinaryDocValues>, IList<IBits>)
Merges the binary docvalues from toMerge
.
The default implementation calls AddBinaryField(FieldInfo, IEnumerable<BytesRef>), passing an System.Collections.Generic.IEnumerable<T> that merges and filters deleted documents on the fly.
Declaration
public virtual void MergeBinaryField(FieldInfo fieldInfo, MergeState mergeState, IList<BinaryDocValues> toMerge, IList<IBits> docsWithField)
Parameters
Type | Name | Description |
---|---|---|
FieldInfo | fieldInfo | |
MergeState | mergeState | |
System.Collections.Generic.IList<BinaryDocValues> | toMerge | |
System.Collections.Generic.IList<IBits> | docsWithField |
MergeNumericField(FieldInfo, MergeState, IList<NumericDocValues>, IList<IBits>)
Merges the numeric docvalues from toMerge
.
The default implementation calls AddNumericField(FieldInfo, IEnumerable<Nullable<Int64>>), passing an System.Collections.Generic.IEnumerable<T> that merges and filters deleted documents on the fly.
Declaration
public virtual void MergeNumericField(FieldInfo fieldInfo, MergeState mergeState, IList<NumericDocValues> toMerge, IList<IBits> docsWithField)
Parameters
Type | Name | Description |
---|---|---|
FieldInfo | fieldInfo | |
MergeState | mergeState | |
System.Collections.Generic.IList<NumericDocValues> | toMerge | |
System.Collections.Generic.IList<IBits> | docsWithField |
MergeSortedField(FieldInfo, MergeState, IList<SortedDocValues>)
Merges the sorted docvalues from toMerge
.
The default implementation calls AddSortedField(FieldInfo, IEnumerable<BytesRef>, IEnumerable<Nullable<Int64>>), passing an System.Collections.Generic.IEnumerable<T> that merges ordinals and values and filters deleted documents.
Declaration
public virtual void MergeSortedField(FieldInfo fieldInfo, MergeState mergeState, IList<SortedDocValues> toMerge)
Parameters
Type | Name | Description |
---|---|---|
FieldInfo | fieldInfo | |
MergeState | mergeState | |
System.Collections.Generic.IList<SortedDocValues> | toMerge |
MergeSortedSetField(FieldInfo, MergeState, IList<SortedSetDocValues>)
Merges the sortedset docvalues from toMerge
.
The default implementation calls AddSortedSetField(FieldInfo, IEnumerable<BytesRef>, IEnumerable<Nullable<Int64>>, IEnumerable<Nullable<Int64>>), passing an System.Collections.Generic.IEnumerable<T> that merges ordinals and values and filters deleted documents.
Declaration
public virtual void MergeSortedSetField(FieldInfo fieldInfo, MergeState mergeState, IList<SortedSetDocValues> toMerge)
Parameters
Type | Name | Description |
---|---|---|
FieldInfo | fieldInfo | |
MergeState | mergeState | |
System.Collections.Generic.IList<SortedSetDocValues> | toMerge |