diff --git a/Classes/Command/NodeIndexQueueCommandController.php b/Classes/Command/NodeIndexQueueCommandController.php index d1b77ff..35246e7 100644 --- a/Classes/Command/NodeIndexQueueCommandController.php +++ b/Classes/Command/NodeIndexQueueCommandController.php @@ -26,6 +26,7 @@ class NodeIndexQueueCommandController extends CommandController const BATCH_QUEUE_NAME = 'Flowpack.ElasticSearch.ContentRepositoryQueueIndexer'; const LIVE_QUEUE_NAME = 'Flowpack.ElasticSearch.ContentRepositoryQueueIndexer.Live'; + const DEFAULT_BATCH_SIZE = 500; /** * @var JobManager @@ -69,6 +70,12 @@ class NodeIndexQueueCommandController extends CommandController */ protected $nodeIndexer; + /** + * @Flow\InjectConfiguration(package="Flowpack.ElasticSearch.ContentRepositoryQueueIndexer") + * @var array + */ + protected $settings; + /** * Index all nodes by creating a new index and when everything was completed, switch the index alias. * @@ -210,7 +217,7 @@ protected function indexWorkspace($workspaceName, $indexPostfix) $this->outputLine('++ Indexing %s workspace', [$workspaceName]); $nodeCounter = 0; $offset = 0; - $batchSize = 500; + $batchSize = $this->settings['batchSize'] ?? static::DEFAULT_BATCH_SIZE; while (true) { $iterator = $this->nodeDataRepository->findAllBySiteAndWorkspace($workspaceName, $offset, $batchSize); diff --git a/Configuration/Settings.yaml b/Configuration/Settings.yaml index 479243b..1aeca68 100644 --- a/Configuration/Settings.yaml +++ b/Configuration/Settings.yaml @@ -2,7 +2,8 @@ Flowpack: ElasticSearch: ContentRepositoryQueueIndexer: enableLiveAsyncIndexing: true - + # Change size of single batch jobs via this setting (fallback default is 500) + # batchSize: 50 JobQueue: Common: queues: