The FieldSchema data type defines the configuration of all fields in a search index.
Data structure
message FieldSchema {
optional string field_name = 1;
optional FieldType field_type = 2;
optional string analyzer = 4;
optional bool index = 5;
optional bool sort_and_agg = 6;
repeated FieldSchema field_schemas = 8; // only for nested type
optional bool is_array = 9;
optional bytes analyzer_parameter = 10;
optional bool is_virtual_field = 11;
repeated string source_field_names = 12;
repeated string date_formats = 13;
optional bool enable_highlighting = 14;
optional VectorOptions vector_options = 15;
optional JsonType json_type = 16;
}Name | Type | Required | Description |
field_name | string | Yes | The name of the field. Important The field name must match the corresponding field name in the data table. |
field_type | Yes | The type of the field. For more information, see Data types. Important The field type for the search index must match the corresponding field type in the data table. | |
analyzer | string | No | The type of tokenizer. The default value is single-word tokenization. Set this parameter only for TEXT fields. |
index | bool | No | Specifies whether to create an index for the field. The default value is true. If this parameter is set to true, an inverted index or a spatial index is created. If you set this parameter to false, no index is created for the field. |
sort_and_agg | bool | No | Specifies whether to enable sorting and aggregation for the field. Only fields that have this feature enabled can be used for sorting. |
field_schemas | No | The configurations of subfields. This parameter is required only when the field type is NESTED. | |
is_array | bool | No | Specifies whether the field is an array. If you set this parameter to true, the field is an array. Data written to this field must be in the JSON array format, such as This parameter is not required for NESTED fields. |
analyzer_parameter | bytes | No | The optional parameter settings for the tokenizer. The value must be marshaled by protobuf. The supported parameters vary based on the tokenizer type. For more information, see Tokenizers. |
is_virtual_field | bool | No | Specifies whether the field is a virtual column. The default value is false. This parameter is required only if you use a virtual column. |
source_field_names | string | No | The names of the source fields in the data table. This parameter is required only if `is_virtual_field` is set to true. |
date_formats | string | No | The date formats. This parameter is required only for DATE fields. |
enable_highlighting | bool | No | Specifies whether to enable query summary and highlighting. The default value is false. Only TEXT fields support this feature. To use query summaries and highlighting, set this parameter to true. |
vector_options | No | The property parameters for the vector field. This parameter is required if the field type is VECTOR. | |
json_type | JsonType | No | The index type of the JSON field. The supported values are OBJECT and Object. This parameter is required if the field type is JSON. |