GroupByHistogram specifies the group by histogram feature. You can use this feature to group query results based on specific data intervals. Field values that are within the same range are grouped together. The value range of each group and the number of values in each group are returned.
Request parameters
message GroupByHistogram {
optional string field_name = 1;
optional bytes interval = 2;
optional bytes missing = 3;
optional int64 min_doc_count = 4;
optional GroupBySort sort = 5;
optional FieldRange field_range = 6;
optional Aggregations sub_aggs = 7;
optional GroupBys sub_group_bys = 8;
}
Parameter | Type | Required | Description |
field_name | string | Yes | The field that is used for aggregation. |
interval | bytes | Yes | The statistical interval. The value must be encoded in PlainBuffer. For more information, see PlainBuffer. |
missing | bytes | No | The default value of a field if the value of the field is empty in the row. The value must be encoded in PlainBuffer. For more information, see PlainBuffer.
|
min_doc_count | int64 | No | The minimum number of rows. If the number of rows in a group is less than the minimum number of rows, the aggregation results for the group are not returned. |
sort | No | The sorting rules for items in a group. By default, group items are sorted in descending order. If you configure multiple sorting rules, data is sorted based on the order in which the rules are configured. | |
field_range | Yes | The range that is used together with the interval parameter to limit the number of groups. The value that is calculated by using the | |
sub_aggs | No | The sub-aggregation operation. You can perform the sub-aggregation operation on the grouping results. | |
sub_group_bys | No | The sub-GroupBy operation. You can perform the sub-GroupBy operation on the grouping results. |
Response parameters
message GroupByHistogramResult {
repeated GroupByHistogramItem group_by_histogra_items = 1;
}
Parameter | Type | Required | Description |
group_by_histogra_items | repeated GroupByHistogramItem | Yes | The information about groups returned. |