Skip to content

Commit 137a2f2

Browse files
committed
TASK: Call buildindex only once
Traversing the dimensions is done in the WorkspaceIndexer
1 parent d37e58b commit 137a2f2

3 files changed

Lines changed: 7 additions & 37 deletions

File tree

Classes/Command/NodeIndexCommandController.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
use Doctrine\Common\Collections\ArrayCollection;
1717
use Flowpack\ElasticSearch\ContentRepositoryAdaptor\Driver\NodeTypeMappingBuilderInterface;
18-
use Flowpack\ElasticSearch\ContentRepositoryAdaptor\EsProfiler;
1918
use Flowpack\ElasticSearch\ContentRepositoryAdaptor\Exception\RuntimeException;
2019
use Flowpack\ElasticSearch\ContentRepositoryAdaptor\Indexer\Error\ErrorInterface;
2120
use Flowpack\ElasticSearch\ContentRepositoryAdaptor\Indexer\NodeIndexer;
@@ -264,8 +263,11 @@ public function buildCommand(int $limit = null, bool $update = false, string $wo
264263
};
265264

266265
$runAndLog($createMapping, 'Create indicies');
267-
$runAndLog($buildIndex, 'Indexing nodes');
268-
$this->outputLine('Batchtime: ' . EsProfiler::getAndReset('estime'));
266+
267+
$timeStart = microtime(true);
268+
$this->output(str_pad('Indexing nodes' . '... ', 20));
269+
$buildIndex([]);
270+
$this->outputLine('<success>Done</success> (took %s seconds)', [number_format(microtime(true) - $timeStart, 2)]);
269271

270272
$runAndLog($refresh, 'Refresh indicies');
271273
$runAndLog($updateAliases, 'Update aliases');

Classes/EsProfiler.php

Lines changed: 0 additions & 33 deletions
This file was deleted.

Classes/Service/IndexWorkspaceTrait.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Neos\Flow\Annotations as Flow;
1919

2020
/**
21+
* @TODO: Unused? Can be removed?
2122
* Index Workspace Trait
2223
*/
2324
trait IndexWorkspaceTrait
@@ -50,7 +51,7 @@ trait IndexWorkspaceTrait
5051
* @param string $workspaceName
5152
* @param int $limit
5253
* @param callable $callback
53-
* @return int
54+
* @return int Count of nodes indexed
5455
*/
5556
protected function indexWorkspace(string $workspaceName, ?int $limit = null, callable $callback = null): int
5657
{

0 commit comments

Comments
 (0)