Skip to content

Commit 5c530a4

Browse files
committed
BUGFIX: Hits are in sub-element value now
1 parent 6c29df0 commit 5c530a4

4 files changed

Lines changed: 6 additions & 9 deletions

File tree

Classes/Command/NodeIndexCommandController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ private function createContentContext(string $workspaceName, array $dimensions =
552552
* @return void
553553
* @throws \Flowpack\ElasticSearch\ContentRepositoryAdaptor\Exception
554554
* @throws \Flowpack\ElasticSearch\Exception
555-
* @throws \Neos\Flow\Http\Exception
555+
* @throws ConfigurationException
556556
*/
557557
private function applyMapping(): void
558558
{

Classes/Eel/ElasticSearchQueryBuilder.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,6 @@ public function fetch(): array
582582
try {
583583
$timeBefore = microtime(true);
584584
$request = $this->request->getRequestAsJson();
585-
\Neos\Flow\var_dump($request, __METHOD__ . ':' . __LINE__);
586585
$response = $this->elasticSearchClient->getIndex()->request('GET', '/_search', [], $request);
587586
$timeAfterwards = microtime(true);
588587

@@ -610,10 +609,9 @@ public function fetch(): array
610609
*/
611610
protected function evaluateResult(array $result): SearchResult
612611
{
613-
\Neos\Flow\var_dump($result['hits']['total'], __METHOD__ . ':' . __LINE__);
614612
return new SearchResult(
615613
$hits = $result['hits']['hits'] ?? [],
616-
$total = $result['hits']['total'] ?? 0
614+
$total = $result['hits']['total']['value'] ?? 0
617615
);
618616
}
619617

Tests/Functional/Indexer/NodeIndexerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function getIndexWithoutDimensionConfigured(): void
6161
{
6262
$this->nodeIndexer->setDimensions([]);
6363
$index = $this->nodeIndexer->getIndex();
64-
static::assertEquals(self::TESTING_INDEX_PREFIX . '-default', $index->getName());
64+
static::assertEquals(self::TESTING_INDEX_PREFIX . '-default-functionaltest', $index->getName());
6565
}
6666

6767
/**
@@ -78,7 +78,7 @@ public function getIndexForDimensionConfiguration(): void
7878
$index = $this->nodeIndexer->getIndex();
7979
$dimesionHash = $this->dimensionService->hash($dimensionValues);
8080

81-
static::assertEquals(self::TESTING_INDEX_PREFIX . '-' . $dimesionHash, $index->getName());
81+
static::assertEquals(self::TESTING_INDEX_PREFIX . '-' . $dimesionHash . '-functionaltest', $index->getName());
8282
}
8383

8484
/**

Tests/Unit/Eel/ElasticSearchQueryBuilderResultTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?php
2-
32
declare(strict_types=1);
43

54
namespace Flowpack\ElasticSearch\ContentRepositoryAdaptor\Tests\Unit\Eel;
@@ -43,7 +42,7 @@ public function ifNoAggregationsAreSetInTheQueyBuilderResultAnEmptyArrayWillBeRe
4342

4443
$actual = $queryResult->getAggregations();
4544

46-
$this->assertIsArray($actual);
47-
$this->assertEmpty($actual);
45+
static::assertIsArray($actual);
46+
static::assertEmpty($actual);
4847
}
4948
}

0 commit comments

Comments
 (0)