elasticsearch/docs/reference/aggregations/pipeline
Benjamin Trent 8069e9b233
[ML] add new bucket_correlation aggregation with initial count_correlation function (#72133)
This commit adds a new pipeline aggregation that allows correlation within the aggregation frame work in bucketed values. 

The initial function is a `count_correlation` function. The purpose of which is to correlate the count in a consistent number of buckets with a pre calculated indicator. The indicator and the aggregated buckets should related to the same metrics with in documents. 

Example for correlating terms within a `service.version.keyword` with latency percentiles. The percentiles and provided correlation indicator both refer to the same source data where the indicator was previously calculated.:
```
GET apm-7.12.0-transaction-generated/_search
{
  "size": 0,
  "aggs": {
    "field_terms": {
      "terms": {
        "field": "service.version.keyword",
        "size": 20
      },
      "aggs": {
        "latency_range": {
          "range": {
            "field": "transaction.duration.us",
            "ranges": [<snip>],
            "keyed": true
          }
        },
        "correlation": {
          "bucket_correlation": {
            "buckets_path": "latency_range>_count",
            "count_correlation": {
              "indicator": {
                 "expectations": [<snip>],
                 "doc_count": 20000
               }
            }
          }
        }
      }
    }
  }
}
```
2021-05-10 12:46:11 -04:00
..
avg-bucket-aggregation.asciidoc
bucket-correlation-aggregation.asciidoc
bucket-script-aggregation.asciidoc
bucket-selector-aggregation.asciidoc
bucket-sort-aggregation.asciidoc
cumulative-cardinality-aggregation.asciidoc
cumulative-sum-aggregation.asciidoc
derivative-aggregation.asciidoc
extended-stats-bucket-aggregation.asciidoc
inference-bucket-aggregation.asciidoc
max-bucket-aggregation.asciidoc
min-bucket-aggregation.asciidoc
movfn-aggregation.asciidoc
moving-percentiles-aggregation.asciidoc
normalize-aggregation.asciidoc
percentiles-bucket-aggregation.asciidoc
serial-diff-aggregation.asciidoc
stats-bucket-aggregation.asciidoc
sum-bucket-aggregation.asciidoc