@@ -135,6 +135,12 @@ class GraphIndexNewCommandController extends CommandController
135135 */
136136 protected $ contentDimensionCombinator ;
137137
138+ /**
139+ * @Flow\Inject
140+ * @var DimensionsService
141+ */
142+ protected $ dimensionService ;
143+
138144 /**
139145 * @Flow\Inject
140146 * @var WorkspaceIndexer
@@ -249,15 +255,9 @@ public function buildCommand(int $limit = null, bool $update = false, string $wo
249255 $ this ->nodeIndexer ->setContentGraph ($ graph );
250256 $ this ->outputLine ('<success>Done</success> (took %s seconds) ' , [number_format (microtime (true ) - $ timeStart , 2 )]);
251257
252- $ dimensionSpacePointSet = $ this ->contentDimensionZookeeper ->getAllowedDimensionSubspace ();
253- $ workspaceDimensionIdentifier = new ContentDimensionIdentifier ('_workspace ' );
254- foreach ($ dimensionSpacePointSet as $ dimensionSpacePoint ) {
255- if ($ dimensionSpacePoint ->getCoordinate ($ workspaceDimensionIdentifier ) === 'live ' ) {
256- $ coordinates = $ dimensionSpacePoint ->getCoordinates ();
257- unset($ coordinates ['_workspace ' ]);
258- $ dimensionSpacepointWithoutWorkspace = new DimensionSpacePoint ($ coordinates );
259- $ this ->buildIndexForDimensionSpacePoint ($ graph , $ dimensionSpacepointWithoutWorkspace , $ postfix , $ limit );
260- }
258+ $ dimensionCombinations = new ArrayCollection ($ this ->contentDimensionCombinator ->getAllAllowedCombinations ());
259+ foreach ($ dimensionCombinations as $ dimensionCombination ) {
260+ $ this ->buildIndexForDimensionSpacePoint ($ graph , $ dimensionCombination , $ postfix , $ limit );
261261 }
262262
263263 $ runAndLog ($ refresh , 'Refresh indicies ' );
@@ -296,18 +296,19 @@ private function aliasesExist(): bool
296296 * Build up the node index
297297 *
298298 * @param ContentGraph $graph
299- * @param DimensionSpacePoint $dimensionSpacePoint
299+ * @param array $dimensionValues
300300 * @param string|null $postfix
301301 * @param int|null $limit
302302 * @throws ConfigurationException
303303 * @throws Exception
304304 * @throws RuntimeException
305305 * @throws SubProcessException
306306 */
307- private function buildIndexForDimensionSpacePoint (ContentGraph $ graph , DimensionSpacePoint $ dimensionSpacePoint , string $ postfix , $ limit = null ): void
307+ private function buildIndexForDimensionSpacePoint (ContentGraph $ graph , array $ dimensionValues , string $ postfix , $ limit = null ): void
308308 {
309- $ dimensionsValues = $ dimensionSpacePoint ->getCoordinates ();
310- $ dimensionsValues = $ this ->configureNodeIndexer ($ dimensionsValues , $ postfix );
309+ $ dimensionsValues = $ this ->configureNodeIndexer ($ dimensionValues , $ postfix );
310+ $ dimensionSpacePoint = DimensionSpacePoint::fromLegacyDimensionArray ($ dimensionsValues );
311+ $ dimensionHash = $ this ->dimensionService ->hash ($ dimensionsValues );
311312
312313 $ this ->output ("Indexing dimension %s " . '... ' , [json_encode ($ dimensionsValues )]);
313314
@@ -331,7 +332,7 @@ private function buildIndexForDimensionSpacePoint(ContentGraph $graph, Dimension
331332 continue ;
332333 }
333334
334- $ this ->nodeIndexer ->indexGraphNode ($ node , $ dimensionSpacePoint );
335+ $ this ->nodeIndexer ->indexGraphNode ($ node , $ dimensionSpacePoint, $ dimensionHash );
335336 $ indexedHierarchyRelations += count ($ node ->getIncomingHierarchyRelations ());
336337 $ nodesSinceLastFlush ++;
337338 $ nodesIndexed ++;
0 commit comments