Constructor Field
Field(String, FieldType)
Expert: creates a field with no initial value. Intended only for custom Field subclasses.
Declaration
protected Field(string name, FieldType type)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | field name |
FieldType | type | field type |
Field(String, TextReader, FieldType)
Create field with
Declaration
public Field(string name, TextReader reader, FieldType type)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | field name |
TextReader | reader | reader value |
FieldType | type | field type |
Field(String, TokenStream, FieldType)
Create field with TokenStream value.
Declaration
public Field(string name, TokenStream tokenStream, FieldType type)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | field name |
TokenStream | tokenStream | TokenStream value |
FieldType | type | field type |
Field(String, Byte[], FieldType)
Create field with binary value.
NOTE: the provided byte[] is not copied so be sure not to change it until you're done with this field.
Declaration
public Field(string name, byte[] value, FieldType type)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | field name |
System.Byte[] | value | byte array pointing to binary content (not copied) |
FieldType | type | field type |
Field(String, Byte[], Int32, Int32, FieldType)
Create field with binary value.
NOTE: the provided byte[] is not copied so be sure not to change it until you're done with this field.
Declaration
public Field(string name, byte[] value, int offset, int length, FieldType type)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | field name |
System.Byte[] | value | byte array pointing to binary content (not copied) |
System.Int32 | offset | starting position of the byte array |
System.Int32 | length | valid length of the byte array |
FieldType | type | field type |
Field(String, BytesRef, FieldType)
Create field with binary value.
NOTE: the provided BytesRef is not copied so be sure not to change it until you're done with this field.
Declaration
public Field(string name, BytesRef bytes, FieldType type)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | field name |
BytesRef | bytes | BytesRef pointing to binary content (not copied) |
FieldType | type | field type |
Field(String, Boolean)
Declaration
protected Field(string name, bool json)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | |
System.Boolean | json |
Field(String, String, FieldType)
Create field with
Declaration
public Field(string name, string value, FieldType type)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | field name |
System.String | value | string value |
FieldType | type | field type |
Field(String, String, Field.Store, Field.Index)
Create a field by specifying its name
, value
and how it will
be saved in the index. Term vectors will not be stored in the index.
Declaration
public Field(string name, string value, Field.Store store, Field.Index index)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the field |
System.String | value | The string to process |
Field.Store | store | Whether |
Field.Index | index | Whether the field should be indexed, and if so, if it should be tokenized before indexing |
Field(String, String, Field.Store, Field.Index, Field.TermVector)
Create a field by specifying its name
, value
and how it will
be saved in the index.
Declaration
public Field(string name, string value, Field.Store store, Field.Index index, Field.TermVector termVector)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the field |
System.String | value | The string to process |
Field.Store | store | Whether |
Field.Index | index | Whether the field should be indexed, and if so, if it should be tokenized before indexing |
Field.TermVector | termVector | Whether term vector should be stored |
Field(String, TextReader)
Create a tokenized and indexed field that is not stored. Term vectors will
not be stored. The
Declaration
public Field(string name, TextReader reader)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the field |
TextReader | reader | The reader with the content |
Field(String, TextReader, Field.TermVector)
Create a tokenized and indexed field that is not stored, optionally with
storing term vectors. The
Declaration
public Field(string name, TextReader reader, Field.TermVector termVector)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the field |
TextReader | reader | The reader with the content |
Field.TermVector | termVector | Whether term vector should be stored |
Field(String, TokenStream)
Create a tokenized and indexed field that is not stored. Term vectors will
not be stored. This is useful for pre-analyzed fields.
The TokenStream is read only when the Document is added to the index,
i.e. you may not close the TokenStream until
Declaration
public Field(string name, TokenStream tokenStream)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the field |
TokenStream | tokenStream | The TokenStream with the content |
Field(String, TokenStream, Field.TermVector)
Create a tokenized and indexed field that is not stored, optionally with
storing term vectors. This is useful for pre-analyzed fields.
The TokenStream is read only when the Document is added to the index,
i.e. you may not close the TokenStream until
Declaration
public Field(string name, TokenStream tokenStream, Field.TermVector termVector)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the field |
TokenStream | tokenStream | The TokenStream with the content |
Field.TermVector | termVector | Whether term vector should be stored |
Field(String, Byte[])
Create a stored field with binary value. Optionally the value may be compressed.
Declaration
public Field(string name, byte[] value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the field |
System.Byte[] | value | The binary value |
Field(String, Byte[], Int32, Int32)
Create a stored field with binary value. Optionally the value may be compressed.
Declaration
public Field(string name, byte[] value, int offset, int length)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the field |
System.Byte[] | value | The binary value |
System.Int32 | offset | Starting offset in value where this Field's bytes are |
System.Int32 | length | Number of bytes to use for this Field, starting at offset |