From e4fcce4b843c27b1fa26598e0f87d9bf1c265d6a Mon Sep 17 00:00:00 2001 From: Paavo Schmid Date: Tue, 10 Feb 2026 10:18:17 +0100 Subject: [PATCH] BUGFIX: Propagate index postfix to NodeIndexerInterface instance When ContentRepositoryQueueIndexer is installed, NodeIndexerInterface resolves to a different singleton than the concrete NodeIndexer class. configureNodeIndexer() only set the postfix on the concrete instance, so the QueueIndexer instance used by NodeIndexingManager had no postfix. This caused nodeindex:build to index into the alias (old index) instead of the new postfixed index. Resolves: #424 --- Classes/Command/NodeIndexCommandController.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Classes/Command/NodeIndexCommandController.php b/Classes/Command/NodeIndexCommandController.php index 259acb30..19dce9e8 100644 --- a/Classes/Command/NodeIndexCommandController.php +++ b/Classes/Command/NodeIndexCommandController.php @@ -23,6 +23,7 @@ use Flowpack\ElasticSearch\ContentRepositoryAdaptor\Exception\RuntimeException; use Flowpack\ElasticSearch\ContentRepositoryAdaptor\Indexer\NodeIndexer; use Flowpack\ElasticSearch\ContentRepositoryAdaptor\Indexer\WorkspaceIndexer; +use Neos\ContentRepository\Search\Indexer\NodeIndexerInterface; use Flowpack\ElasticSearch\Domain\Model\Mapping; use Flowpack\ElasticSearch\Transfer\Exception\ApiException; use Neos\ContentRepository\Domain\Model\Workspace; @@ -145,6 +146,12 @@ class NodeIndexCommandController extends CommandController */ protected $indexDriver; + /** + * @Flow\Inject + * @var NodeIndexerInterface + */ + protected $nodeIndexerInterface; + /** * Index a single node by the given identifier and workspace name * @@ -503,6 +510,13 @@ private function configureNodeIndexer(array $dimensionsValues, string $postfix): { $this->nodeIndexer->setIndexNamePostfix($postfix); $this->nodeIndexer->setDimensions($dimensionsValues); + + // Also configure the interface instance (separate singleton when QueueIndexer is installed) + if ($this->nodeIndexerInterface instanceof NodeIndexer && $this->nodeIndexerInterface !== $this->nodeIndexer) { + $this->nodeIndexerInterface->setIndexNamePostfix($postfix); + $this->nodeIndexerInterface->setDimensions($dimensionsValues); + } + return $dimensionsValues; }