All Products
Search
Document Center

Tablestore:GroupByRange

Last Updated:Apr 30, 2026

GroupByRange groups search results into buckets based on numeric ranges. Each bucket covers a left-closed, right-open interval and returns the number of matched rows within that range.

Request parameters

message GroupByRange {
    optional string field_name = 1;
    repeated Range ranges = 2;
    optional Aggregations sub_aggs = 3;
    optional GroupBys sub_group_bys = 4;
}

Parameter

Type

Required

Description

field_name

string

Yes

The numeric field to group by.

ranges

repeated Range

Yes

The range intervals to create buckets for. Each interval is left-closed and right-open: [from, to).

sub_aggs

Aggregations

No

A sub-aggregation to run on each bucket.

sub_group_bys

GroupBys

No

A sub-GroupBy to run on each bucket.

Response parameters

message GroupByRangeResult {
    repeated GroupByRangeResultItem group_by_range_result_items = 1;
}

Parameter

Type

Required

Description

group_by_range_result_items

repeated GroupByRangeResultItem

Yes

The list of buckets returned, one per range interval.