Files
OpenSearch-Docs-Cn/_aggregations/metric/value-count.md
T
a87fdc0f63 Split query DSL, analyzer, and aggregation sections and add more to analyzer section (#4693)
* Add analyzer documentation

Signed-off-by: Fanit Kolchina <[email protected]>

* Add index and search analyzer pages

Signed-off-by: Fanit Kolchina <[email protected]>

* Doc review comments

Signed-off-by: Fanit Kolchina <[email protected]>

* Apply suggestions from code review

Co-authored-by: Melissa Vagi <[email protected]>
Signed-off-by: kolchfa-aws <[email protected]>

* More doc review comments

Signed-off-by: Fanit Kolchina <[email protected]>

* Apply suggestions from code review

Co-authored-by: Nathan Bower <[email protected]>
Signed-off-by: kolchfa-aws <[email protected]>

* Implemented editorial comments

Signed-off-by: Fanit Kolchina <[email protected]>

* Update index-analyzers.md

Signed-off-by: kolchfa-aws <[email protected]>

---------

Signed-off-by: Fanit Kolchina <[email protected]>
Signed-off-by: kolchfa-aws <[email protected]>
Co-authored-by: Melissa Vagi <[email protected]>
Co-authored-by: Nathan Bower <[email protected]>
2023-08-08 09:41:55 -04:00

840 B

layout, title, parent, grand_parent, nav_order, redirect_from
layout title parent grand_parent nav_order redirect_from
default Value count Metric aggregations Aggregations 140
/query-dsl/aggregations/metric/value-count/

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"
      }
    }
  }
}

{% include copy-curl.html %}

Example response

...
  "aggregations" : {
    "number_of_values" : {
      "value" : 4675
    }
  }
}