All Products
Search
Document Center

Tablestore:FieldSort

Last Updated:May 10, 2024

FieldSort specifies the sorting configuration for a field in a search index.

Data structure

message FieldSort {
    optional string field_name = 1;
    optional SortOrder order = 2;
    optional SortMode mode = 3;
    optional NestedFilter nested_filter = 4;
    optional bytes missing_value = 5; //encoded as SQLVariant
    optional string missing_field = 6;
}

Parameter

Type

Required

Description

field_name

string

Yes

The name of the field.

order

SortOrder

No

The sorting method. You can sort fields in the ascending or descending order. By default, fields are sorted in the ascending order.

mode

SortMode

No

The sorting method that is used when the field has multiple values. This parameter is required only when the field type is array.

Note

For more information about array types, see ARRAY and Nested field types.

nested_filter

NestedFilter

No

The filter condition of fields in the nested data type. This parameter is required only if the fields are of the nested data type.

missing_value

bytes

No

The default value that is used when the specified field does not exist. The value must be encoded in PlainBuffer. For more information, see PlainBuffer.

missing_field

string

No

The sorting field that is used when the specified field does not exist.