GroupByDateHistogram groups query results into date-based intervals. Rows whose field values fall within the same interval are placed in the same group. Each group returns its value range and the number of matching rows.
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 to aggregate on. |
|
interval |
Yes |
The interval configuration. |
|
|
field_range |
Yes |
The value range used together with |
|
|
missing |
bytes |
No |
The default value for rows where the field is empty. The value must be encoded in PlainBuffer format. For more information, see PlainBuffer.
|
|
min_doc_count |
int64 |
No |
The minimum number of rows a group must contain to be included in the results. Groups with fewer rows are excluded. |
|
time_zone |
string |
No |
The time zone offset in |
|
sort |
No |
The sort rules for groups. Groups are sorted in descending order by default. When multiple rules are specified, they are applied in the order listed. |
|
|
sub_aggs |
No |
Sub-aggregations to run on each group's results. |
|
|
sub_group_bys |
No |
Sub-GroupBy operations to run on each group's 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. |