Struct DataType | Azure SDK for Net
Rachel Davis
Published Feb 16, 2026
Defines the data type of a field in a search index.
Namespace: Microsoft.Azure.Search.Models
Assembly: Microsoft.Azure.Search.Service.dll
Syntax
[Newtonsoft.Json.JsonConverter(typeof(Microsoft.Azure.Search.Serialization.ExtensibleEnumConverter`1<Microsoft.Azure.Search.Models.DataType>))]
public struct DataType : IEquatable<Microsoft.Azure.Search.Models.DataType> Fields
Boolean
Indicates that a field contains a Boolean value (true or false).
Declaration
public static readonly Microsoft.Azure.Search.Models.DataType Boolean; Field Value
Complex
Indicates that a field contains one or more complex objects that in turn have sub-fields of other types.
Declaration
public static readonly Microsoft.Azure.Search.Models.DataType Complex; Field Value
DateTimeOffset
Indicates that a field contains a date/time value, including timezone information.
Declaration
public static readonly Microsoft.Azure.Search.Models.DataType DateTimeOffset; Field Value
Double
Indicates that a field contains an IEEE double-precision floating point number.
Declaration
public static readonly Microsoft.Azure.Search.Models.DataType Double; Field Value
GeographyPoint
Indicates that a field contains a geo-location in terms of longitude and latitude.
Declaration
public static readonly Microsoft.Azure.Search.Models.DataType GeographyPoint; Field Value
Int32
Indicates that a field contains a 32-bit signed integer.
Declaration
public static readonly Microsoft.Azure.Search.Models.DataType Int32; Field Value
Int64
Indicates that a field contains a 64-bit signed integer.
Declaration
public static readonly Microsoft.Azure.Search.Models.DataType Int64; Field Value
String
Indicates that a field contains a string.
Declaration
public static readonly Microsoft.Azure.Search.Models.DataType String; Field Value
Methods
Collection(DataType)
Creates a DataType for a collection of the given type.
Declaration
public static Microsoft.Azure.Search.Models.DataType Collection (Microsoft.Azure.Search.Models.DataType elementType); Parameters
| DataType elementType The DataType of the elements of the collection. |
Returns
| DataType A new DataType for a collection. |
Equals(DataType)
Compares the DataType for equality with another DataType.
Declaration
public bool Equals (Microsoft.Azure.Search.Models.DataType other); Parameters
| DataType other The DataType with which to compare. |
Returns
| Boolean
|
Equals(Object)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals (object obj); Parameters
| Object obj The object to compare with the current object. |
Returns
| Boolean
|
GetHashCode()
Serves as the default hash function.
Declaration
public override int GetHashCode (); Returns
| Int32 A hash code for the current object. |
ToString()
Returns a string representation of the DataType.
Declaration
public override string ToString (); Returns
| String The DataType as a string. |
Operators
Equality(DataType, DataType)
Compares two DataType values for equality.
Declaration
public static bool operator == (Microsoft.Azure.Search.Models.DataType lhs, Microsoft.Azure.Search.Models.DataType rhs); Parameters
| DataType lhs The first DataType to compare. |
| DataType rhs The second DataType to compare. |
Returns
| Boolean true if the DataType objects are equal or are both null; false otherwise. |
Explicit(DataType to String)
Defines explicit conversion from DataType to string.
Declaration
public static explicit operator string (Microsoft.Azure.Search.Models.DataType dataType); Parameters
Returns
| String The DataType as a string. |
Implicit(String to DataType)
Defines implicit conversion from string to DataType.
Declaration
public static implicit operator Microsoft.Azure.Search.Models.DataType (string value); Parameters
| String value string to convert. |
Returns
Inequality(DataType, DataType)
Compares two DataType values for inequality.
Declaration
public static bool operator != (Microsoft.Azure.Search.Models.DataType lhs, Microsoft.Azure.Search.Models.DataType rhs); Parameters
| DataType lhs The first DataType to compare. |
| DataType rhs The second DataType to compare. |
Returns
| Boolean true if the DataType objects are not equal; false otherwise. |