Completed
Push — develop ( 5325d9...9f3a91 )
by Sam
11s
created

MaxAggregation::setField()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 4
loc 4
rs 10
c 0
b 0
f 0
1
<?php namespace Nord\Lumen\Elasticsearch\Search\Aggregation\Metrics;
2
3
/**
4
 * A single-value metrics aggregation that keeps track and returns the maximum value among the numeric values extracted
5
 * from the aggregated documents. These values can be extracted either from specific numeric fields in the documents, or
6
 * be generated by a provided script.
7
 *
8
 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-max-aggregation.html
9
 */
10
class MaxAggregation extends AbstractAggregation
11
{
12
    /**
13
     * @inheritdoc
14
     */
15
    public function toArray()
16
    {
17
        return [
18
            'max' => [
19
                'field' => $this->getField()
20
            ]
21
        ];
22
    }
23
}
24