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 |
order | 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 | 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 | No | The method for calculating the geographical distance. | |
nested_filter | 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. |