Parameter | Type | Required | Valid value | Default value | Description |
group_key:field | field: an attribute field | Yes | Fields of the INT, LITERAL, INT_ARRAY, or LITERAL_ARRAY type. If the attribute field is of the INT_ARRAY or LITERAL_ARRAY type and an item in the array is repeated, the number of its occurrences is counted. | | Specifies the name of the field for which you want to collect statistics. You must configure an attribute field in this parameter. |
agg_fun | | Yes | The built-in functions count(), sum(id), max(id), min(id), and distinct_count(id). | | You can set func to the count(), sum(id), max(id), min(id), or distinct_count(id) built-in function to calculate the number of documents, the sum of field values, the maximum field value, the minimum field value, or the number of unique values in a field. You can use multiple functions at a time by separating them with number signs (#). You can reference multiple fields in the sum(), max(), or min() function by using basic arithmetic operators. |
range | | No | The values between Number 1 and Number 2 and values greater than Number 2. Values of fields of the STRING type cannot be aggregated to collect statistics. | | Generates statistics based on value ranges. This parameter can be used for data distribution. You can specify only one range parameter in the aggregate clause. |
agg_filter | | No | | | Retrieves documents that meet the specified conditions. |
agg_sampler_threshold | INT | No | | | Specifies the threshold for document sampling. The retrieved documents whose ranks are higher than the threshold are counted in sequence in statistics, whereas those whose ranks are lower than the threshold are sampled based on the value of the agg_sampler_step parameter. |
agg_sampler_step | INT | No | | | Specifies the sampling step size. The value indicates the intervals at which the documents whose ranks are lower than the threshold specified by the agg_sampler_threshold parameter are sampled. Statistics that are collected by the sum() and count() functions are processed in the following way: The system multiplies the statistics of documents whose ranks are lower than the threshold by the sampling step size to generate the estimated statistics. Then, the system adds the estimated statistics to the statistics of documents whose ranks are higher than the threshold to generate the final statistics. |
max_group | INT | No | | 1000 | Specifies the maximum number of key-items pairs that can be returned. |