Class LazyDocument.LazyField
Note
This API is for internal purposes only and might change in incompatible ways in the next release.
Inherited Members
Namespace: Lucene.Net.Documents
Assembly: Lucene.Net.Misc.dll
Syntax
public class LazyDocument.LazyField : IIndexableField, IFormattable
Properties
Boost
Gets the boost factor on this field.
Declaration
public virtual float Boost { get; }
Property Value
| Type | Description |
|---|---|
| float |
FieldType
Returns the Lucene.Net.Documents.FieldType for this field as type Lucene.Net.Documents.FieldType.
Declaration
public virtual FieldType FieldType { get; }
Property Value
| Type | Description |
|---|---|
| FieldType |
HasBeenLoaded
non-private for test only access
Note
This API is for internal purposes only and might change in incompatible ways in the next release.
Declaration
public virtual bool HasBeenLoaded { get; }
Property Value
| Type | Description |
|---|---|
| bool |
IndexableFieldType
Returns the Lucene.Net.Documents.FieldType for this field as type Lucene.Net.Index.IIndexableFieldType.
Declaration
public virtual IIndexableFieldType IndexableFieldType { get; }
Property Value
| Type | Description |
|---|---|
| IIndexableFieldType |
Name
The field's name
Declaration
public virtual string Name { get; }
Property Value
| Type | Description |
|---|---|
| string |
NumericType
Gets the Lucene.Net.Documents.NumericFieldType of the underlying value, or Lucene.Net.Documents.NumericFieldType.NONE if the value is not set or non-numeric.
Expert: The difference between this property and Lucene.Net.Documents.FieldType.NumericType is this is represents the current state of the field (whether being written or read) and the FieldType property represents instructions on how the field will be written, but does not re-populate when reading back from an index (it is write-only). In Java, the numeric type was determined by checking the type of GetNumericValue(). However, since there are no reference number types in .NET, using GetNumericValue() so will cause boxing/unboxing. It is therefore recommended to use this property to check the underlying type and the correspondingGet*Value() method to retrieve the value.
NOTE: Since Lucene codecs do not support Lucene.Net.Documents.NumericFieldType.BYTE or Lucene.Net.Documents.NumericFieldType.INT16,
fields created with these types will always be Lucene.Net.Documents.NumericFieldType.INT32 when read back from the index.
Declaration
public virtual NumericFieldType NumericType { get; }
Property Value
| Type | Description |
|---|---|
| NumericFieldType |
Methods
GetBinaryValue()
Non-null if this field has a binary value.
Declaration
public virtual BytesRef GetBinaryValue()
Returns
| Type | Description |
|---|---|
| BytesRef |
GetByteValue()
Returns the field value as byte or null if the type
is non-numeric.
Declaration
public virtual byte? GetByteValue()
Returns
| Type | Description |
|---|---|
| byte? | The field value or |
GetDoubleValue()
Returns the field value as double or null if the type
is non-numeric.
Declaration
public virtual double? GetDoubleValue()
Returns
| Type | Description |
|---|---|
| double? | The field value or |
GetInt16Value()
Returns the field value as short or null if the type
is non-numeric.
Declaration
public virtual short? GetInt16Value()
Returns
| Type | Description |
|---|---|
| short? | The field value or |
GetInt32Value()
Returns the field value as int or null if the type
is non-numeric.
Declaration
public virtual int? GetInt32Value()
Returns
| Type | Description |
|---|---|
| int? | The field value or |
GetInt64Value()
Returns the field value as long or null if the type
is non-numeric.
Declaration
public virtual long? GetInt64Value()
Returns
| Type | Description |
|---|---|
| long? | The field value or |
GetNumericValue()
Non-null if this field has a numeric value.
Declaration
[Obsolete("In .NET, use of this method will cause boxing/unboxing. Instead, use the NumericType property to check the underlying type and call the appropriate GetXXXValue() method to retrieve the value.")]
public virtual object GetNumericValue()
Returns
| Type | Description |
|---|---|
| object |
GetReaderValue()
The value of the field as a TextReader, or null. If null, the string value or
binary value is used. Exactly one of GetStringValue(), GetReaderValue(), and
GetBinaryValue() must be set.
Declaration
public virtual TextReader GetReaderValue()
Returns
| Type | Description |
|---|---|
| TextReader |
GetSingleValue()
Returns the field value as float or null if the type
is non-numeric.
Declaration
public virtual float? GetSingleValue()
Returns
| Type | Description |
|---|---|
| float? | The field value or |
GetStringValue()
The value of the field as a string, or null. If null, the TextReader value or
binary value is used. Exactly one of GetStringValue(), GetReaderValue(), and
GetBinaryValue() must be set.
Declaration
public virtual string GetStringValue()
Returns
| Type | Description |
|---|---|
| string | The string representation of the value if it is either a string or numeric type. |
GetStringValue(IFormatProvider)
The value of the field as a string, or null. If null, the TextReader value or
binary value is used. Exactly one of GetStringValue(), GetReaderValue(), and
GetBinaryValue() must be set.
Declaration
public virtual string GetStringValue(IFormatProvider provider)
Parameters
| Type | Name | Description |
|---|---|---|
| IFormatProvider | provider | An object that supplies culture-specific formatting information. This parameter has no effect if this field is non-numeric. |
Returns
| Type | Description |
|---|---|
| string | The string representation of the value if it is either a string or numeric type. |
GetStringValue(string)
The value of the field as a string, or null. If null, the TextReader value or
binary value is used. Exactly one of GetStringValue(), GetReaderValue(), and
GetBinaryValue() must be set.
Declaration
public virtual string GetStringValue(string format)
Parameters
| Type | Name | Description |
|---|---|---|
| string | format | A standard or custom numeric format string. This parameter has no effect if this field is non-numeric. |
Returns
| Type | Description |
|---|---|
| string | The string representation of the value if it is either a string or numeric type. |
GetStringValue(string, IFormatProvider)
The value of the field as a string, or null. If null, the TextReader value or
binary value is used. Exactly one of GetStringValue(), GetReaderValue(), and
GetBinaryValue() must be set.
Declaration
public virtual string GetStringValue(string format, IFormatProvider provider)
Parameters
| Type | Name | Description |
|---|---|---|
| string | format | A standard or custom numeric format string. This parameter has no effect if this field is non-numeric. |
| IFormatProvider | provider | An object that supplies culture-specific formatting information. This parameter has no effect if this field is non-numeric. |
Returns
| Type | Description |
|---|---|
| string | The string representation of the value if it is either a string or numeric type. |
GetTokenStream(Analyzer)
Creates the Lucene.Net.Analysis.TokenStream used for indexing this field. If appropriate, implementations should use the given Lucene.Net.Analysis.Analyzer to create the Lucene.Net.Analysis.TokenStreams.
Declaration
public virtual TokenStream GetTokenStream(Analyzer analyzer)
Parameters
| Type | Name | Description |
|---|---|---|
| Analyzer | analyzer | Lucene.Net.Analysis.Analyzer that should be used to create the Lucene.Net.Analysis.TokenStreams from |
Returns
| Type | Description |
|---|---|
| TokenStream | Lucene.Net.Analysis.TokenStream value for indexing the document. Should always return a non-null value if the field is to be indexed |
Exceptions
| Type | Condition |
|---|---|
| IOException | Can be thrown while creating the Lucene.Net.Analysis.TokenStream |
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string that represents the current object. |
Overrides
ToString(IFormatProvider)
Note
This API is for internal purposes only and might change in incompatible ways in the next release.
Declaration
public virtual string ToString(IFormatProvider provider)
Parameters
| Type | Name | Description |
|---|---|---|
| IFormatProvider | provider |
Returns
| Type | Description |
|---|---|
| string |
ToString(string)
Note
This API is for internal purposes only and might change in incompatible ways in the next release.
Declaration
public virtual string ToString(string format)
Parameters
| Type | Name | Description |
|---|---|---|
| string | format |
Returns
| Type | Description |
|---|---|
| string |
ToString(string, IFormatProvider)
Formats the value of the current instance using the specified format.
Declaration
public virtual string ToString(string format, IFormatProvider provider)
Parameters
| Type | Name | Description |
|---|---|---|
| string | format | The format to use. -or- A null reference ( |
| IFormatProvider | provider |
Returns
| Type | Description |
|---|---|
| string | The value of the current instance in the specified format. |