Skip to content

Commit 301154e

Browse files
Merge pull request #354 from daniellienert/bugfix/multi-dimension-indexnode
BUGFIX: nodeindex:indexnode handles multiple dimensions
2 parents 1fb6f0a + 6f6edb0 commit 301154e

2 files changed

Lines changed: 11 additions & 12 deletions

File tree

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ cache:
2323
- $HOME/.composer/cache
2424

2525
before_install:
26-
- export NEOS_TARGET_VERSION=5.2
26+
- export NEOS_TARGET_VERSION=5.3
2727
- cd ..
2828
- if [ "$ES" = 6 ]; then wget --no-check-certificate https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.8.6.tar.gz && tar xvfz elasticsearch-6.8.6.tar.gz && mv elasticsearch-6.8.6 elasticsearch; fi
2929
- if [ "$ES" = 7 ]; then wget --no-check-certificate https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.9.0-linux-x86_64.tar.gz && tar xvfz elasticsearch-7.9.0-linux-x86_64.tar.gz && mv elasticsearch-7.9.0 elasticsearch; fi
@@ -35,7 +35,6 @@ before_install:
3535
- composer require --no-update --no-interaction neos/content-repository-search:dev-master
3636
- composer require --no-update --no-interaction flowpack/elasticsearch:dev-master
3737
- composer require --no-update --no-interaction flowpack/elasticsearch-contentrepositoryadaptor:dev-master
38-
- composer require --no-update --no-interaction neos/nodetypes
3938
- composer remove --no-update --no-interaction neos/site-kickstarter
4039
install:
4140
- composer install --no-interaction

Classes/Command/NodeIndexCommandController.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -161,29 +161,29 @@ public function indexNodeCommand(string $identifier, string $workspace = null, s
161161
$node = $context->getNodeByIdentifier($identifier);
162162

163163
if ($node === null) {
164-
$this->outputLine('<error>Error: Node with the given identifier was not found.</error>');
165-
$this->quit(1);
164+
return [$workspace->getName(), '-', json_encode($dimensions), 'not found'];
166165
}
167166

168-
$this->outputLine();
169-
$this->outputLine('Indexing node <b>"%s"</b> (%s)', [$node->getLabel(), $node->getIdentifier(),]);
170-
$this->outputLine(' Workspace: %s', [$workspace->getName()]);
171-
$this->outputLine(' Node type: %s', [$node->getNodeType()->getName()]);
172-
$this->outputLine(' Dimensions: %s', [json_encode($dimensions)]);
173-
174167
$this->nodeIndexer->setDimensions($dimensions);
175168
$this->nodeIndexer->indexNode($node);
169+
170+
return [$workspace->getName(), $node->getNodeType()->getName(), json_encode($dimensions), '<success>indexed</success>'];
176171
};
177172

178173
$indexInWorkspace = function ($identifier, Workspace $workspace) use ($indexNode) {
179174
$combinations = $this->contentDimensionCombinator->getAllAllowedCombinations();
175+
176+
$results = [];
177+
180178
if ($combinations === []) {
181-
$indexNode($identifier, $workspace, []);
179+
$results[] = $indexNode($identifier, $workspace, []);
182180
} else {
183181
foreach ($combinations as $combination) {
184-
$indexNode($identifier, $workspace, $combination);
182+
$results[] = $indexNode($identifier, $workspace, $combination);
185183
}
186184
}
185+
186+
$this->output->outputTable($results, ['Workspace', 'NodeType', 'Dimensions', 'State']);
187187
};
188188

189189
if ($workspace === null) {

0 commit comments

Comments
 (0)