anchor.diff:  sets `max` as the field's `default_metric`.
   
   [source,console]
  ---------------------------------------------------
  +----
   PUT stats-index
   {
     "mappings": {
       "properties": {
         "agg_metric": {
           "type": "aggregate_metric_double",
  -        "metrics": [ "min", "max", "sum", "value_count"],
  +        "metrics": [ "min", "max", "sum", "value_count" ],
           "default_metric": "max"
         }
       }
     }
   }
  ---------------------------------------------------
  -// TEST[skip:awaiting fix]
  +----
   
   The following <<docs-index_,index>> API request adds documents with
   pre-aggregated data in the `agg_metric` field.
   
   [source,console]
  ---------------------------------------------------
  +----
   PUT stats-index/_doc/1
   {
  -    "agg_metric": {
  -        "min": -302.50,
  -        "max": 702.30,
  -        "sum": 200.0,
  -        "value_count": 25
  -    }
  +  "agg_metric": {
  +    "min": -302.50,
  +    "max": 702.30,
  +    "sum": 200.0,
  +    "value_count": 25
  +  }
   }
   
   PUT stats-index/_doc/2
   {
  -    "agg_metric": {
  -        "min": -93.00,
  -        "max": 1702.30,
  -        "sum": 300.00,
  -        "value_count": 25
  -    }
  -}
  ---------------------------------------------------
  -// TEST[skip:awaiting fix]
  +  "agg_metric": {
  +    "min": -93.00,
  +    "max": 1702.30,
  +    "sum": 300.00,
  +    "value_count": 25
  +  }
  +}
  +----
  +// TEST[continued]
  +// TEST[s/_doc\/2/_doc\/2?refresh=wait_for/]
   
   You can run `min`, `max`, `sum`, `value_count`, and `avg` aggregations on a
   `agg_metric` field.
   
   [source,console]
  ---------------------------------------------------
  +----
   POST stats-index/_search?size=0
   {
  -    "aggs" : {
  -        "metric_min" : { "min" : { "field" : "agg_metric" } },
  -        "metric_max" : { "max" : { "field" : "agg_metric" } },
  -        "metric_value_count" : { "value_count" : { "field" : "agg_metric" } },
  -        "metric_sum" : { "sum" : { "field" : "agg_metric" } },
  -        "metric_avg" : { "avg" : { "field" : "agg_metric" } }
  -    }
  -}
  ---------------------------------------------------
  -// TEST[skip:awaiting fix]
  +  "aggs": {
  +    "metric_min": { "min": { "field": "agg_metric" } },
  +    "metric_max": { "max": { "field": "agg_metric" } },
  +    "metric_value_count": { "value_count": { "field": "agg_metric" } },
  +    "metric_sum": { "sum": { "field": "agg_metric" } },
  +    "metric_avg": { "avg": { "field": "agg_metric" } }
  +  }
  +}
  +----
  +// TEST[continued]
   
   The aggregation results are based on related metric sub-field values.
   
   [source,console-result]
  ---------------------------------------------------
  +----
   {
   ...
  -  "aggregations" : {
  -    "metric_min" : {
  -      "value" : -302.5
  -    },
  -    "metric_max" : {
  -      "value" : 1702.3
  -    },
  -    "metric_value_count" : {
  -      "value" : 50
  -    },
  -    "metric_sum" : {
  -      "value" : 500.0
  -    },
  -    "metric_avg" : {
  -      "value" : 10.0
  -    }
  -  }
  -}
  ---------------------------------------------------
  -// TESTRESPONSE[skip:awaiting fix]
  +  "aggregations": {
  +    "metric_min": {
  +      "value": -302.5
  +    },
  +    "metric_max": {
  +      "value": 1702.3
  +    },
  +    "metric_value_count": {
  +      "value": 50
  +    },
  +    "metric_sum": {
  +      "value": 500.0
  +    },
  +    "metric_avg": {
  +      "value": 10.0
  +    }
  +  }
  +}
  +----
   // TESTRESPONSE[s/\.\.\./"took": $body.took,"timed_out": false,"_shards": $body._shards,"hits": $body.hits,/]
   
  -
   Queries on a `aggregate_metric_double` field use the `default_metric` value.
   
   [source,console]
  ---------------------------------------------------
  +----
   GET stats-index/_search
   {
     "query": {
  
positive.code: [source,console]
  ----
  PUT my-index
    "mappings": {
      "properties": {
        "my-agg-metric-field": {
          "type": "aggregate_metric_double",
          "metrics": [ "min", "max", "sum", "value_count"],
          "default_metric": "max"
        }
      }
    }
  }
  ----
  // TEST[skip:awaiting fix]
  
  [[aggregate-metric-double-params]]
  ==== Parameters for `aggregate_metric_double` fields
  
negative.code: and `value_count` metrics. To run an `avg` aggregation, the field must contain
  both `sum` and `value_count` metric sub-field.
  
  If you use an `aggregate_metric_double` field with other aggregations, the field
  uses the `default_metric` value, which behaves as a `double` field. The
  `default_metric` is also used in scripts and the following queries:
  