Link Search Menu Expand Document Documentation Menu

You're viewing version 2.13 of the OpenSearch documentation. This version is no longer maintained. For the latest version, see the current documentation. For information about OpenSearch version maintenance, see Release Schedule and Maintenance Policy.

Minimum aggregations

The min metric is a single-value metric aggregations that returns the minimum value of a field.

The following example calculates the minimum of the taxful_total_price field:

GET opensearch_dashboards_sample_data_ecommerce/_search
{
  "size": 0,
  "aggs": {
    "min_taxful_total_price": {
      "min": {
        "field": "taxful_total_price"
      }
    }
  }
}

Example response

{
  "took": 13,
  "timed_out": false,
  "_shards": {
    "total": 1,
    "successful": 1,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": {
      "value": 4675,
      "relation": "eq"
    },
    "max_score": null,
    "hits": []
  },
  "aggregations": {
    "min_taxful_total_price": {
      "value": 6.98828125
    }
  }
}
350 characters left

Have a question? .

Want to contribute? or .