Skip to content

Commit

Permalink
Write tests for NestedFilteredAggregation
Browse files Browse the repository at this point in the history
  • Loading branch information
Bart van Asselt committed Apr 25, 2024
1 parent fb90b9b commit dbd766c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Application/Results.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function aggregations(): array

foreach ($this->rawResults['aggregations'] as $name => $rawAggregation) {
if (array_key_exists('doc_count', $rawAggregation)) {
$aggregations = array_merge($aggregations, $this->parseNestedAggregation($rawAggregation));
$aggregations = array_merge($aggregations, $this->parseNestedAggregations($rawAggregation));
continue;
}

Expand All @@ -50,7 +50,7 @@ public function count(): int
}

/** @return AggregationResult[] */
private function parseNestedAggregation(array $rawAggregation): array {
private function parseNestedAggregations(array $rawAggregation): array {
$aggregations = [];
if (array_key_exists('doc_count', $rawAggregation)) {
foreach ($rawAggregation as $nestedAggregationName => $rawNestedAggregation) {
Expand All @@ -59,7 +59,7 @@ private function parseNestedAggregation(array $rawAggregation): array {
}

if(is_array($rawNestedAggregation)) {
$aggregations = array_merge($aggregations, $this->parseNestedAggregation($rawNestedAggregation));
$aggregations = array_merge($aggregations, $this->parseNestedAggregations($rawNestedAggregation));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Domain/Aggregations/NestedFilteredAggregation.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function __construct(string $path, string $name, string $field, array $fi
/**
* @return array<string, mixed>
*/
public function buildElasticFilters(): array
private function buildElasticFilters(): array
{
$elasticFilters = [];
foreach ($this->filters as $field => $filterValues) {
Expand Down

0 comments on commit dbd766c

Please sign in to comment.