Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class FieldType

    Describes the properties of a field.

    Inheritance
    object
    FieldType
    Implements
    IIndexableFieldType
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Lucene.Net.Documents
    Assembly: Lucene.Net.dll
    Syntax
    public class FieldType : IIndexableFieldType

    Constructors

    FieldType()

    Create a new FieldType with default properties.

    Declaration
    public FieldType()

    FieldType(FieldType)

    Create a new mutable FieldType with all of the properties from ref

    Declaration
    public FieldType(FieldType @ref)
    Parameters
    Type Name Description
    FieldType ref

    Properties

    DocValueType

    Sets the field's DocValuesType, or set to NONE if no DocValues should be stored.

    The default is NONE (no DocValues).
    Declaration
    public virtual DocValuesType DocValueType { get; set; }
    Property Value
    Type Description
    DocValuesType
    Exceptions
    Type Condition
    InvalidOperationException

    if this FieldType is frozen against future modifications.

    IndexOptions

    Sets the indexing options for the field.

    The default is DOCS_AND_FREQS_AND_POSITIONS.
    Declaration
    public virtual IndexOptions IndexOptions { get; set; }
    Property Value
    Type Description
    IndexOptions
    Exceptions
    Type Condition
    InvalidOperationException

    if this FieldType is frozen against future modifications.

    IsIndexed

    Set to true to index (invert) this field. The default is false.

    Declaration
    public virtual bool IsIndexed { get; set; }
    Property Value
    Type Description
    bool
    Exceptions
    Type Condition
    InvalidOperationException

    if this FieldType is frozen against future modifications.

    IsStored

    Set to true to store this field. The default is false.

    Declaration
    public virtual bool IsStored { get; set; }
    Property Value
    Type Description
    bool
    Exceptions
    Type Condition
    InvalidOperationException

    if this FieldType is frozen against future modifications.

    IsTokenized

    Set to true to tokenize this field's contents via the configured Analyzer. The default is true.

    Declaration
    public virtual bool IsTokenized { get; set; }
    Property Value
    Type Description
    bool
    Exceptions
    Type Condition
    InvalidOperationException

    if this FieldType is frozen against future modifications.

    NumericPrecisionStep

    Sets the numeric precision step for the field.

    This has no effect if NumericType is NONE.

    The default is PRECISION_STEP_DEFAULT.
    Declaration
    public virtual int NumericPrecisionStep { get; set; }
    Property Value
    Type Description
    int
    Exceptions
    Type Condition
    ArgumentException

    if precisionStep is less than 1.

    InvalidOperationException

    if this FieldType is frozen against future modifications.

    NumericType

    Specifies the field's numeric type, or set to NONE if the field has no numeric type. If not NONE then the field's value will be indexed numerically so that NumericRangeQuery can be used at search time.

    The default is NONE.
    Declaration
    public virtual NumericType NumericType { get; set; }
    Property Value
    Type Description
    NumericType
    Exceptions
    Type Condition
    InvalidOperationException

    if this FieldType is frozen against future modifications.

    OmitNorms

    Set to true to omit normalization values for the field. The default is false.

    Declaration
    public virtual bool OmitNorms { get; set; }
    Property Value
    Type Description
    bool
    Exceptions
    Type Condition
    InvalidOperationException

    if this FieldType is frozen against future modifications.

    StoreTermVectorOffsets

    Set to true to also store token character offsets into the term vector for this field. The default is false.

    Declaration
    public virtual bool StoreTermVectorOffsets { get; set; }
    Property Value
    Type Description
    bool
    Exceptions
    Type Condition
    InvalidOperationException

    if this FieldType is frozen against future modifications.

    StoreTermVectorPayloads

    Set to true to also store token payloads into the term vector for this field. The default is false.

    Declaration
    public virtual bool StoreTermVectorPayloads { get; set; }
    Property Value
    Type Description
    bool
    Exceptions
    Type Condition
    InvalidOperationException

    if this FieldType is frozen against future modifications.

    StoreTermVectorPositions

    Set to true to also store token positions into the term vector for this field. The default is false.

    Declaration
    public virtual bool StoreTermVectorPositions { get; set; }
    Property Value
    Type Description
    bool
    Exceptions
    Type Condition
    InvalidOperationException

    if this FieldType is frozen against future modifications.

    StoreTermVectors

    Set to true if this field's indexed form should be also stored into term vectors. The default is false.

    Declaration
    public virtual bool StoreTermVectors { get; set; }
    Property Value
    Type Description
    bool
    Exceptions
    Type Condition
    InvalidOperationException

    if this FieldType is frozen against future modifications.

    Methods

    Freeze()

    Prevents future changes. Note, it is recommended that this is called once the FieldType's properties have been set, to prevent unintentional state changes.

    Declaration
    public virtual FieldType Freeze()
    Returns
    Type Description
    FieldType

    this

    ToString()

    Prints a FieldType for human consumption.

    Declaration
    public override sealed string ToString()
    Returns
    Type Description
    string
    Overrides
    object.ToString()

    Implements

    IIndexableFieldType
    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.