Class FieldInfo
Access to the Field Info file that describes document fields and whether or not they are indexed. Each segment has a separate Field Info file. Objects of this class are thread-safe for multiple readers, but only one thread can be adding documents at a time, with no other reader or writer threads accessing this object.
Inherited Members
Namespace: Lucene.Net.Index
Assembly: Lucene.Net.dll
Syntax
public sealed class FieldInfo
Constructors
FieldInfo(string, bool, int, bool, bool, bool, IndexOptions, DocValuesType, DocValuesType, IDictionary<string, string>)
Sole Constructor.
Note
This API is experimental and might change in incompatible ways in the next release.
Declaration
public FieldInfo(string name, bool indexed, int number, bool storeTermVector, bool omitNorms, bool storePayloads, IndexOptions indexOptions, DocValuesType docValues, DocValuesType normsType, IDictionary<string, string> attributes)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | |
| bool | indexed | |
| int | number | |
| bool | storeTermVector | |
| bool | omitNorms | |
| bool | storePayloads | |
| IndexOptions | indexOptions | |
| DocValuesType | docValues | |
| DocValuesType | normsType | |
| IDictionary<string, string> | attributes |
Properties
Attributes
Returns internal codec attributes map. May be null if no mappings exist.
Declaration
public IDictionary<string, string> Attributes { get; }
Property Value
| Type | Description |
|---|---|
| IDictionary<string, string> |
DocValuesGen
Gets or Sets the docValues generation of this field, or -1 if no docValues.
Declaration
public long DocValuesGen { get; set; }
Property Value
| Type | Description |
|---|---|
| long |
DocValuesType
Access to the Field Info file that describes document fields and whether or not they are indexed. Each segment has a separate Field Info file. Objects of this class are thread-safe for multiple readers, but only one thread can be adding documents at a time, with no other reader or writer threads accessing this object.
Declaration
public DocValuesType DocValuesType { get; }
Property Value
| Type | Description |
|---|---|
| DocValuesType |
HasDocValues
Returns true if this field has any docValues.
Declaration
public bool HasDocValues { get; }
Property Value
| Type | Description |
|---|---|
| bool |
HasNorms
Returns true if this field actually has any norms.
Declaration
public bool HasNorms { get; }
Property Value
| Type | Description |
|---|---|
| bool |
HasPayloads
Returns true if any payloads exist for this field.
Declaration
public bool HasPayloads { get; }
Property Value
| Type | Description |
|---|---|
| bool |
HasVectors
Returns true if any term vectors exist for this field.
Declaration
public bool HasVectors { get; }
Property Value
| Type | Description |
|---|---|
| bool |
IndexOptions
Returns IndexOptions for the field, or null if the field is not indexed
Declaration
public IndexOptions IndexOptions { get; }
Property Value
| Type | Description |
|---|---|
| IndexOptions |
IsIndexed
Returns true if this field is indexed.
Declaration
public bool IsIndexed { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Name
Field's name
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| string |
NormType
Returns DocValuesType of the norm. This may be NONE if the field has no norms.
Declaration
public DocValuesType NormType { get; }
Property Value
| Type | Description |
|---|---|
| DocValuesType |
Number
Internal field number
Declaration
public int Number { get; }
Property Value
| Type | Description |
|---|---|
| int |
OmitsNorms
Returns true if norms are explicitly omitted for this field
Declaration
public bool OmitsNorms { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
GetAttribute(string)
Get a codec attribute value, or null if it does not exist
Declaration
public string GetAttribute(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key |
Returns
| Type | Description |
|---|---|
| string |
PutAttribute(string, string)
Puts a codec attribute value.
this is a key-value mapping for the field that the codec can use to store additional metadata, and will be available to the codec when reading the segment via GetAttribute(string) If a value already exists for the field, it will be replaced with the new value.Declaration
public string PutAttribute(string key, string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | |
| string | value |
Returns
| Type | Description |
|---|---|
| string |