Fork me on GitHub
  • API

    Show / Hide Table of Contents

    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:
    1. DocValuesConsumer is created by FieldsConsumer(SegmentWriteState) or NormsConsumer(SegmentWriteState).
    2. AddNumericField(FieldInfo, IEnumerable<long?>), AddBinaryField(FieldInfo, IEnumerable<BytesRef>), or AddSortedField(FieldInfo, IEnumerable<BytesRef>, IEnumerable<long?>) 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 (GetEnumerator()).
    3. After all fields are added, the consumer is Dispose()d.

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Inheritance
    object
    DocValuesConsumer
    Lucene45DocValuesConsumer
    Implements
    IDisposable
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Lucene.Net.Codecs
    Assembly: Lucene.Net.dll
    Syntax
    public abstract class DocValuesConsumer : IDisposable

    Constructors

    DocValuesConsumer()

    Sole constructor. (For invocation by subclass constructors, typically implicit.)

    Declaration
    protected DocValuesConsumer()

    Methods

    AddBinaryField(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.

    IEnumerable<BytesRef> values

    IEnumerable<T> of binary values (one for each document). null indicates a missing value.

    Exceptions
    Type Condition
    IOException

    If an I/O error occurred.

    AddNumericField(FieldInfo, IEnumerable<long?>)

    Writes numeric docvalues for a field.

    Declaration
    public abstract void AddNumericField(FieldInfo field, IEnumerable<long?> values)
    Parameters
    Type Name Description
    FieldInfo field

    Field information.

    IEnumerable<long?> values

    IEnumerable<T> of numeric values (one for each document). null indicates a missing value.

    Exceptions
    Type Condition
    IOException

    If an I/O error occurred.

    AddSortedField(FieldInfo, IEnumerable<BytesRef>, IEnumerable<long?>)

    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.

    IEnumerable<BytesRef> values

    IEnumerable<T> of binary values in sorted order (deduplicated).

    IEnumerable<long?> docToOrd

    IEnumerable<T> of ordinals (one for each document). -1 indicates a missing value.

    Exceptions
    Type Condition
    IOException

    If an I/O error occurred.

    AddSortedSetField(FieldInfo, IEnumerable<BytesRef>, IEnumerable<long?>, IEnumerable<long?>)

    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.

    IEnumerable<BytesRef> values

    IEnumerable<T> of binary values in sorted order (deduplicated).

    IEnumerable<long?> docToOrdCount

    IEnumerable<T> of the number of values for each document. A zero ordinal count indicates a missing value.

    IEnumerable<long?> ords

    IEnumerable<T> of ordinal occurrences (docToOrdCount*maxDoc total).

    Exceptions
    Type Condition
    IOException

    If an I/O error occurred.

    Dispose()

    Disposes all resources used by this object.

    Declaration
    public void Dispose()

    Dispose(bool)

    Implementations must override and should dispose all resources used by this instance.

    Declaration
    protected abstract void Dispose(bool disposing)
    Parameters
    Type Name Description
    bool disposing

    MergeBinaryField(FieldInfo, MergeState, IList<BinaryDocValues>, IList<IBits>)

    Merges the binary docvalues from toMerge.

    The default implementation calls AddBinaryField(FieldInfo, IEnumerable<BytesRef>), passing an 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
    IList<BinaryDocValues> toMerge
    IList<IBits> docsWithField

    MergeNumericField(FieldInfo, MergeState, IList<NumericDocValues>, IList<IBits>)

    Merges the numeric docvalues from toMerge.

    The default implementation calls AddNumericField(FieldInfo, IEnumerable<long?>), passing an 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
    IList<NumericDocValues> toMerge
    IList<IBits> docsWithField

    MergeSortedField(FieldInfo, MergeState, IList<SortedDocValues>)

    Merges the sorted docvalues from toMerge.

    The default implementation calls AddSortedField(FieldInfo, IEnumerable<BytesRef>, IEnumerable<long?>), passing an 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
    IList<SortedDocValues> toMerge

    MergeSortedSetField(FieldInfo, MergeState, IList<SortedSetDocValues>)

    Merges the sortedset docvalues from toMerge.

    The default implementation calls AddSortedSetField(FieldInfo, IEnumerable<BytesRef>, IEnumerable<long?>, IEnumerable<long?>), passing an 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
    IList<SortedSetDocValues> toMerge

    Implements

    IDisposable
    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.