All Products
Search
Document Center

Tablestore:Sorter

Last Updated:May 11, 2024

Sorter specifies the sorting method of the index. You can specify one of the four sorting methods. By default, PrimaryKeySort is used for non-Nested fields in search indexes. and no sorting is configured for search indexes that do not contain Nested fields.

Data structure

message Sorter {
    optional FieldSort field_sort = 1;
    optional GeoDistanceSort geo_distance_sort = 2;
    optional ScoreSort score_sort = 3;
    optional PrimaryKeySort pk_sort = 4;
}

Parameter

Type

Required

Description

field_sort

FieldSort

No

Specifies sorting based on field values.

geo_distance_sort

GeoDistanceSort

No

Specifies sorting based on geographic locations.

score_sort

ScoreSort

No

Specifies sorting based on the BM25-based keyword relevance score.

pk_sort

PrimaryKeySort

No

Specifies sorting based on the primary key.