| @@ 41-48 (lines=8) @@ | ||
| 38 | * |
|
| 39 | * @return array |
|
| 40 | */ |
|
| 41 | public function getValue($name = 'key') |
|
| 42 | { |
|
| 43 | if (!isset($this->rawData[$name])) { |
|
| 44 | return null; |
|
| 45 | } |
|
| 46 | ||
| 47 | return $this->rawData[$name]; |
|
| 48 | } |
|
| 49 | ||
| 50 | /** |
|
| 51 | * Returns the document count of the aggregation |
|
| @@ 87-94 (lines=8) @@ | ||
| 84 | * |
|
| 85 | * @return AggregationValue|null |
|
| 86 | */ |
|
| 87 | public function getAggregation($name) |
|
| 88 | { |
|
| 89 | if (!isset($this->rawData[$name])) { |
|
| 90 | return null; |
|
| 91 | } |
|
| 92 | ||
| 93 | return new self($this->rawData[$name]); |
|
| 94 | } |
|
| 95 | ||
| 96 | /** |
|
| 97 | * Applies path method to aggregations. |
|
| @@ 81-88 (lines=8) @@ | ||
| 78 | * |
|
| 79 | * @return integer |
|
| 80 | */ |
|
| 81 | public function getCount($name) |
|
| 82 | { |
|
| 83 | if (!isset($this->rawData[$name])) { |
|
| 84 | return null; |
|
| 85 | } |
|
| 86 | ||
| 87 | return $this->rawData[$name]['hits']['total']; |
|
| 88 | } |
|
| 89 | ||
| 90 | /** |
|
| 91 | * Returns inner hits for a specified inner hit |
|