kolchfa-aws 02f40d7efd
Refactor metric aggregation section (#4543)
* Refactor metric aggregation section

Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>

* Update _query-dsl/aggregations/metric/matrix-stats.md

Co-authored-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Signed-off-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com>

* Update _query-dsl/aggregations/metric/extended-stats.md

Co-authored-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Signed-off-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com>

---------

Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>
Signed-off-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com>
Co-authored-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
2023-07-12 11:39:20 -04:00

911 B

layout title parent grand_parent nav_order
default Maximum Metric aggregations Aggregations 60

Maximum aggregations

The max metric is a single-value metric aggregations that returns the maximum value of a field.

The following example calculates the maximum of the taxful_total_price field:

GET opensearch_dashboards_sample_data_ecommerce/_search
{
  "size": 0,
  "aggs": {
    "max_taxful_total_price": {
      "max": {
        "field": "taxful_total_price"
      }
    }
  }
}

{% include copy-curl.html %}

Example response

{
  "took": 17,
  "timed_out": false,
  "_shards": {
    "total": 1,
    "successful": 1,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": {
      "value": 4675,
      "relation": "eq"
    },
    "max_score": null,
    "hits": []
  },
  "aggregations": {
    "max_taxful_total_price": {
      "value": 2250
    }
  }
}