This topic describes the mappings between field data types in data tables and search indexes, and the additional attributes supported by different data types of fields.

The value of a field in a search index is the value of the field with the same name in the data table for which the search index is created. The data types of the two values must match. The following table describes the matching rules.

Important The data types of the values in the search index must match the data types in the data table based on the rules described in the following table. Otherwise, Tablestore discards the data as dirty data. Make sure that field values of the Geo-point and Nested types comply with the formats described in the following table. If the formats do not match, Tablestore discards the data as dirty data. In this case, the data may be available in the data table but unavailable in the search index for queries.
Field data type in search indexes Field data type in data tables Description
Long Integer 64-bit long integers.
Double Double 64-bit double-precision floating-point numbers.
Boolean Boolean Boolean values.
Keyword String Character strings that cannot be tokenized.
Text String

Character strings or text that can be tokenized. For more information about tokenization, see Tokenization.

Date Integer and String The Date data type. You can specify the format of data of the Date type. For more information, see Types of date data.
Geo-point String The coordinate information about the location. This parameter value must be in the format of latitude,longitude. Valid values of the latitude: [-90,+90]. Valid values of the longitude: [-180,+180]. Example: 35.8,-45.91.
Nested String The nested type. Example: [{"a": 1}, {"a": 3}].

The following table describes the additional attributes of fields in search indexes.

Attribute Type Description
IsArray Boolean Specifies whether the value of the column is an array.

The value of true indicates that the value of the column is an array. Data written to the column must be a JSON array such as ["a","b","c"].

You do not need to specify the IsArray attribute for a nested column because a nested column is an array.

Data of the ARRAY type can be used in all queries because arrays do not affect queries.

isVirtualField Boolean Specifies whether the column is a virtual column.
  • If you set this parameter to true, the column is a virtual column. If the column is a virtual column, you must specify the source field that is mapped to the column. For more information, see Virtual columns.
  • If you set this parameter to false, the column is not a virtual column. In this case, the data type of the column in the search index must match the data type of the column in the data table.
The following table describes the combinations of data types and field attributes.
Type IsArray isVirtualField
Long Supported Supported
Double Supported Supported
Boolean Supported Not supported
Keyword Supported Supported
Text Supported Supported
Date Supported Supported
Geo-point Supported Supported
Nested Nested fields are arrays. Not supported