Data Types - Azure Cognitive Search
Azure Cognitive Search supports the following data types:
- Edm.String
- Edm.Int32 and Edm.Int64
- Edm.Double
- Edm.Boolean
- Edm.DateTimeOffset
- Edm.GeographyPoint
- Collection data types
Edm.String
Edm.String is used for text data. This data type is commonly used for fields such as names, descriptions, and titles.
{
"name": "productTitle",
"type": "Edm.String",
"searchable": true,
"filterable": true,
"sortable": true,
"facetable": true,
"retrievable": true
}
Edm.Int32 and Edm.Int64
Edm.Int32 and Edm.Int64 are used for integer data. Edm.Int32 supports values from -2,147,483,648 to 2,147,483,647, while Edm.Int64 supports values from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807. These data types are commonly used for fields such as prices, quantities, and ratings.
{
"name": "productPrice",
"type": "Edm.Int32",
"filterable": true,
"sortable": true,
"facetable": true,
"retrievable": true
}
Edm.Double
Edm.Double is used for floating-point numeric data. This data type is commonly used for fields such as prices, weights, and measurements.
{
"name": "productWeight",
"type": "Edm.Double",
"filterable": true,
"sortable": true,
"retrievable": true
}
Edm.Boolean
Edm.Boolean is used for Boolean data. This data type is commonly used for fields that indicate true or false, such as availability or product status.
{
"name": "productAvailability",
"type": "Edm.Boolean",
"filterable": true,
"sortable": true,
"facetable": true,
"retrievable": true
}
Edm.DateTimeOffset
Edm.DateTimeOffset is used for date and time data. This data type is commonly used for fields such as created dates, modified dates, and expiration dates.
{
"name": "productCreatedDate",
"type": "Edm.DateTimeOffset",
"filterable": true,
"sortable": true,
"retrievable": true
}
Edm.GeographyPoint
Edm.GeographyPoint is used for geospatial data. This data type is commonly used for fields that store latitude and longitude information, such as location data.
{
"name": "productLocation",
"type": "Edm.GeographyPoint",
"retrievable": true
}
Collection data types
Collection data types allow you to store arrays of data in a single field. For example, if you have a field that stores multiple categories for a product, you can define it as Collection(Edm.String).
{
"name": "productCategories",
"type": "Collection(Edm.String)",
"filterable": true,
"facetable": true,
"retrievable": true
}
Applies to Collection(Edm.Int32), Collection(Edm.Int64), Collection(Edm.Double), Collection(Edm.Boolean), Collection(Edm.DateTimeOffset), Collection(Edm.GeographyPoint)