Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class PerFieldDocValuesFormat

    Enables per field docvalues support.

    Note, when extending this class, the name (Name) is written into the index. In order for the field to be read, the name must resolve to your implementation via ForName(string). This method uses GetDocValuesFormat(string) to resolve format names. See DefaultDocValuesFormatFactory for information about how to implement your own DocValuesFormat.

    Files written by each docvalues format have an additional suffix containing the format name. For example, in a per-field configuration instead of _1.dat filenames would look like _1_Lucene40_0.dat.

    Note

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

    Inheritance
    object
    DocValuesFormat
    PerFieldDocValuesFormat
    Inherited Members
    DocValuesFormat.SetDocValuesFormatFactory(IDocValuesFormatFactory)
    DocValuesFormat.GetDocValuesFormatFactory()
    DocValuesFormat.Name
    DocValuesFormat.ToString()
    DocValuesFormat.ForName(string)
    DocValuesFormat.AvailableDocValuesFormats
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Lucene.Net.Codecs.PerField
    Assembly: Lucene.Net.dll
    Syntax
    [DocValuesFormatName("PerFieldDV40")]
    public abstract class PerFieldDocValuesFormat : DocValuesFormat

    Constructors

    PerFieldDocValuesFormat()

    Sole constructor.

    Declaration
    protected PerFieldDocValuesFormat()
    See Also
    IDocValuesFormatFactory
    DefaultDocValuesFormatFactory

    Fields

    PER_FIELD_FORMAT_KEY

    FieldInfo attribute name used to store the format name for each field.

    Declaration
    public static readonly string PER_FIELD_FORMAT_KEY
    Field Value
    Type Description
    string
    See Also
    IDocValuesFormatFactory
    DefaultDocValuesFormatFactory

    PER_FIELD_SUFFIX_KEY

    FieldInfo attribute name used to store the segment suffix name for each field.

    Declaration
    public static readonly string PER_FIELD_SUFFIX_KEY
    Field Value
    Type Description
    string
    See Also
    IDocValuesFormatFactory
    DefaultDocValuesFormatFactory

    Methods

    FieldsConsumer(SegmentWriteState)

    Returns a DocValuesConsumer to write docvalues to the index.

    Declaration
    public override sealed DocValuesConsumer FieldsConsumer(SegmentWriteState state)
    Parameters
    Type Name Description
    SegmentWriteState state
    Returns
    Type Description
    DocValuesConsumer
    Overrides
    DocValuesFormat.FieldsConsumer(SegmentWriteState)
    See Also
    IDocValuesFormatFactory
    DefaultDocValuesFormatFactory

    FieldsProducer(SegmentReadState)

    Returns a DocValuesProducer to read docvalues from the index.

    NOTE: by the time this call returns, it must hold open any files it will need to use; else, those files may be deleted. Additionally, required files may be deleted during the execution of this call before there is a chance to open them. Under these circumstances an IOException should be thrown by the implementation. IOExceptions are expected and will automatically cause a retry of the segment opening logic with the newly revised segments.
    Declaration
    public override sealed DocValuesProducer FieldsProducer(SegmentReadState state)
    Parameters
    Type Name Description
    SegmentReadState state
    Returns
    Type Description
    DocValuesProducer
    Overrides
    DocValuesFormat.FieldsProducer(SegmentReadState)
    See Also
    IDocValuesFormatFactory
    DefaultDocValuesFormatFactory

    GetDocValuesFormatForField(string)

    Returns the doc values format that should be used for writing new segments of field.

    The field to format mapping is written to the index, so this method is only invoked when writing, not when reading.
    Declaration
    public abstract DocValuesFormat GetDocValuesFormatForField(string field)
    Parameters
    Type Name Description
    string field
    Returns
    Type Description
    DocValuesFormat
    See Also
    IDocValuesFormatFactory
    DefaultDocValuesFormatFactory

    See Also

    IDocValuesFormatFactory
    DefaultDocValuesFormatFactory
    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.