All Products
Search
Document Center

Tablestore:GeoDistanceSort

Last Updated:May 11, 2024

GeoDistanceSort specifies sorting based on geographical locations.

Data structure

message GeoDistanceSort {
    optional string field_name = 1;
    repeated string points = 2;
    optional SortOrder order = 3;
    optional SortMode mode = 4;
    optional GeoDistanceType distance_type = 5;
    optional NestedFilter nested_filter = 6;
}

Parameter

Type

Required

Description

field_name

string

Yes

The name of the field.

points

string

Yes

The coordinate pair of the central point. The coordinate pair consists of latitude and longitude values. 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.

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. If you sort fields in the ascending order, points that are nearer to the central point are placed at the beginning.

mode

SortMode

No

A field of the array type has multiple values. This parameter specifies which value is used for sorting when the field has multiple values.

distance_type

GeoDistanceType

No

The method for calculating the geographical distance.

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.