This version of the OpenSearch documentation is no longer maintained. For the latest version, see the current documentation. For information about OpenSearch version maintenance, see Release Schedule and Maintenance Policy.
Value count aggregations
The value_count
metric is a single-value metric aggregation that calculates the number of values that an aggregation is based on.
For example, you can use the value_count
metric with the avg
metric to find how many numbers the aggregation uses to calculate an average value.
GET opensearch_dashboards_sample_data_ecommerce/_search
{
"size": 0,
"aggs": {
"number_of_values": {
"value_count": {
"field": "taxful_total_price"
}
}
}
}
copy
Example response
...
"aggregations" : {
"number_of_values" : {
"value" : 4675
}
}
}
当前内容版权归 OpenSearch 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 OpenSearch .