Aggregation::setName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 2
c 2
b 0
f 0
dl 0
loc 5
rs 10
cc 1
nc 1
nop 1
1
<?php namespace Nord\Lumen\Elasticsearch\Search\Aggregation;
2
3
use Illuminate\Contracts\Support\Arrayable;
4
5
/**
6
 * The aggregations framework helps provide aggregated data based on a search query. It is based on simple building
7
 * blocks called aggregations, that can be composed in order to build complex summaries of the data.
8
 *
9
 * An aggregation can be seen as a unit-of-work that builds analytic information over a set of documents. The context of
10
 * the execution defines what this document set is (e.g. a top-level aggregation executes within the context of the
11
 * executed query/filters of the search request).
12
 *
13
 * There are many different types of aggregations, each with its own purpose and output. To better understand these
14
 * types, it is often easier to break them into three main families:
15
 *
16
 * - "Bucketing"
17
 * A family of aggregations that build buckets, where each bucket is associated with a key and a document criterion.
18
 * When the aggregation is executed, all the buckets criteria are evaluated on every document in the context and when a
19
 * criterion matches, the document is considered to "fall in" the relevant bucket. By the end of the aggregation
20
 * process, we’ll end up with a list of buckets - each one with a set of documents that "belong" to it.
21
 *
22
 * - "Metric"
23
 * Aggregations that keep track and compute metrics over a set of documents.
24
 *
25
 * - "Pipeline"
26
 * Aggregations that aggregate the output of other aggregations and their associated metrics
27
 *
28
 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations.html
29
 */
30
abstract class Aggregation implements Arrayable
31
{
32
33
    /**
34
     * @var string
35
     */
36
    private $name;
37
38
    /**
39
     * @return string
40
     */
41
    public function getName()
42
    {
43
        return $this->name;
44
    }
45
46
    /**
47
     * @param string $name
48
     *
49
     * @return $this
50
     */
51
    public function setName($name)
52
    {
53
        $this->name = $name;
54
55
        return $this;
56
    }
57
}
58