@@ -28,7 +28,6 @@ class NodeIndexQueueCommandController extends CommandController
2828
2929 const BATCH_QUEUE_NAME = 'Flowpack.ElasticSearch.ContentRepositoryQueueIndexer ' ;
3030 const LIVE_QUEUE_NAME = 'Flowpack.ElasticSearch.ContentRepositoryQueueIndexer.Live ' ;
31- const DEFAULT_BATCH_SIZE = 500 ;
3231
3332 /**
3433 * @var JobManager
@@ -73,10 +72,10 @@ class NodeIndexQueueCommandController extends CommandController
7372 protected $ nodeIndexer ;
7473
7574 /**
76- * @Flow\InjectConfiguration(package="Flowpack.ElasticSearch.ContentRepositoryQueueIndexer ")
77- * @var array
75+ * @Flow\InjectConfiguration(path="batchSize ")
76+ * @var int
7877 */
79- protected $ settings ;
78+ protected $ batchSize ;
8079
8180 /**
8281 * Index all nodes by creating a new index and when everything was completed, switch the index alias.
@@ -228,9 +227,8 @@ protected function indexWorkspace($workspaceName, $indexPostfix)
228227 $ this ->outputLine ('<info>++</info> Indexing %s workspace ' , [$ workspaceName ]);
229228 $ nodeCounter = 0 ;
230229 $ offset = 0 ;
231- $ batchSize = $ this ->settings ['batchSize ' ] ?? static ::DEFAULT_BATCH_SIZE ;
232230 while (true ) {
233- $ iterator = $ this ->nodeDataRepository ->findAllBySiteAndWorkspace ($ workspaceName , $ offset , $ batchSize );
231+ $ iterator = $ this ->nodeDataRepository ->findAllBySiteAndWorkspace ($ workspaceName , $ offset , $ this -> batchSize );
234232
235233 $ jobData = [];
236234
@@ -252,7 +250,7 @@ protected function indexWorkspace($workspaceName, $indexPostfix)
252250 $ indexingJob = new IndexingJob ($ indexPostfix , $ workspaceName , $ jobData );
253251 $ this ->jobManager ->queue (self ::BATCH_QUEUE_NAME , $ indexingJob );
254252 $ this ->output ('. ' );
255- $ offset += $ batchSize ;
253+ $ offset += $ this -> batchSize ;
256254 $ this ->persistenceManager ->clearState ();
257255 }
258256 $ this ->outputLine ();
0 commit comments