diff --git a/src/Common/Elasticsearch/QueryBuilder.php b/src/Common/Elasticsearch/QueryBuilder.php index 85b700b..6dd0162 100644 --- a/src/Common/Elasticsearch/QueryBuilder.php +++ b/src/Common/Elasticsearch/QueryBuilder.php @@ -100,11 +100,11 @@ public function build(): array $query = current($this->queries); return $this->addAggregation([ - 'query' => [ - $query['queryType'] => [ - $query['fieldName'] => $query['fieldValue'], - ], - ], + 'query' => [ + $query['queryType'] => [ + $query['fieldName'] => $query['fieldValue'], + ], + ], ]); } @@ -134,10 +134,10 @@ public function build(): array $output['bool'][$qualifierType] = []; } $output['bool'][$qualifierType][] = [ - $query['queryType'] => [ - $query['fieldName'] => $query['fieldValue'], - ], - ]; + $query['queryType'] => [ + $query['fieldName'] => $query['fieldValue'], + ], + ]; } } diff --git a/tests/Parthenon/Common/Elasticsearch/QueryBuilderTest.php b/tests/Parthenon/Common/Elasticsearch/QueryBuilderTest.php index 031877e..e353dc8 100644 --- a/tests/Parthenon/Common/Elasticsearch/QueryBuilderTest.php +++ b/tests/Parthenon/Common/Elasticsearch/QueryBuilderTest.php @@ -71,19 +71,19 @@ public function testDealsWithTwoQueries() ->query('match', 'secondField', 'secondValue') ->build(); $this->assertEquals([ - 'query' => [ - 'bool' => [ - 'must' => [ - [ - 'match' => ['fieldName' => 'fieldValue'], - ], - [ - 'match' => ['secondField' => 'secondValue'], + 'query' => [ + 'bool' => [ + 'must' => [ + [ + 'match' => ['fieldName' => 'fieldValue'], + ], + [ + 'match' => ['secondField' => 'secondValue'], + ], + ], ], ], - ], - ], - ], $output); + ], $output); } public function testDealsWithTwoQueriesAndTwoNotQueries() diff --git a/tests/Parthenon/Export/Exporter/CsvExporterTest.php b/tests/Parthenon/Export/Exporter/CsvExporterTest.php index 3e15c97..0af0cb5 100644 --- a/tests/Parthenon/Export/Exporter/CsvExporterTest.php +++ b/tests/Parthenon/Export/Exporter/CsvExporterTest.php @@ -41,8 +41,8 @@ public function testExportBasicArray() ',value_four,value_three'.PHP_EOL; $rows = [ - ['column_one' => 'value', 'column_two' => 'value_two'], - ['column_three' => 'value_three', 'column_two' => 'value_four'], + ['column_one' => 'value', 'column_two' => 'value_two'], + ['column_three' => 'value_three', 'column_two' => 'value_four'], ]; $this->assertEquals($expected, $exporter->getOutput($rows));