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; }