GroupByDateHistogram groups 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 GroupByDateHistogram {
optional string field_name = 1;
optional DateTimeValue interval = 2;
optional FieldRange field_range = 3;
optional bytes missing = 4;
optional int64 min_doc_count = 5;
optional string time_zone = 6;
optional GroupBySort sort = 7;
optional Aggregations sub_aggs = 8;
optional GroupBys sub_group_bys = 9;
}
Parameter | Type | Required | Description |
field_name | string | Yes | The field that is used for aggregation. |
interval | Yes | The interval configuration. | |
field_range | Yes | The range that is used together with the interval parameter to limit the number of groups. | |
missing | bytes | No | The default value of a field if the value of the field is empty in the row. The value of the parameter is 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. |
time_zone | string | No | The time zone in the |
sort | No | The sorting rules for items in a group. By default, 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. | |
sub_aggs | No | The sub-aggregation operation that is performed based on the grouping results. | |
sub_group_bys | No | The sub-GroupBy operation that is performed based on the grouping results. |
Response parameters
message GroupByDateHistogramResult {
repeated GroupByDateHistogramItem group_by_date_histogram_items = 1;
}
Parameter | Type | Required | Description |
group_by_date_histogram_items | repeated GroupByDateHistogramItem | Yes | The returned groups. |