Class FieldType
Describes the properties of a field.
Inheritance
Implements
Inherited Members
Namespace: Lucene.Net.Documents
Assembly: Lucene.Net.dll
Syntax
public class FieldType : IIndexableFieldTypeConstructors
| Improve this Doc View SourceFieldType()
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
| Improve this Doc View SourceDocValueType
Sets the field's DocValuesType, or set to NONE if no DocValues should be stored.
Declaration
public virtual DocValuesType DocValueType { get; set; }Property Value
| Type | Description | 
|---|---|
| DocValuesType | 
Exceptions
| Type | Condition | 
|---|---|
| System.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 | 
|---|---|
| System.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 | 
|---|---|
| System.Boolean | 
Exceptions
| Type | Condition | 
|---|---|
| System.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 | 
|---|---|
| System.Boolean | 
Exceptions
| Type | Condition | 
|---|---|
| System.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 false.
Declaration
public virtual bool IsTokenized { get; set; }Property Value
| Type | Description | 
|---|---|
| System.Boolean | 
Exceptions
| Type | Condition | 
|---|---|
| System.InvalidOperationException | if this FieldType is frozen against future modifications. | 
NumericPrecisionStep
Sets the numeric precision step for the field.
This has no effect if NumericType returns NONE.
The default is PRECISION_STEP_DEFAULT.
Declaration
public virtual int NumericPrecisionStep { get; set; }Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
Exceptions
| Type | Condition | 
|---|---|
| System.ArgumentException | if precisionStep is less than 1. | 
| System.InvalidOperationException | if this FieldType is frozen against future modifications. | 
NumericType
Specifies the field's numeric type, or set to null if the field has no numeric type.
If non-null then the field's value will be indexed numerically so that 
NumericRangeQuery can be used at search time.
Declaration
public virtual NumericType NumericType { get; set; }Property Value
| Type | Description | 
|---|---|
| NumericType | 
Exceptions
| Type | Condition | 
|---|---|
| System.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 | 
|---|---|
| System.Boolean | 
Exceptions
| Type | Condition | 
|---|---|
| System.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 | 
|---|---|
| System.Boolean | 
Exceptions
| Type | Condition | 
|---|---|
| System.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 | 
|---|---|
| System.Boolean | 
Exceptions
| Type | Condition | 
|---|---|
| System.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 | 
|---|---|
| System.Boolean | 
Exceptions
| Type | Condition | 
|---|---|
| System.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 | 
|---|---|
| System.Boolean | 
Exceptions
| Type | Condition | 
|---|---|
| System.InvalidOperationException | if this FieldType is frozen against future modifications. | 
Methods
| Improve this Doc View SourceFreeze()
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 void Freeze()ToString()
Prints a FieldType for human consumption.
Declaration
public override sealed string ToString()Returns
| Type | Description | 
|---|---|
| System.String |