@@ -26,15 +26,16 @@ class IndexBuilder extends AbstractIndexBuilder implements UpdatableIndexBuilder
26
26
protected IndexerInterface $ priceIndexer ;
27
27
28
28
public function __construct (
29
- protected ConfigHelper $ configHelper ,
30
- protected DiagnosticsLogger $ logger ,
31
- protected Emulation $ emulation ,
32
- protected ScopeCodeResolver $ scopeCodeResolver ,
33
- protected AlgoliaHelper $ algoliaHelper ,
34
- protected ProductHelper $ productHelper ,
35
- protected ResourceConnection $ resource ,
36
- protected ManagerInterface $ eventManager ,
37
- IndexerRegistry $ indexerRegistry
29
+ protected ConfigHelper $ configHelper ,
30
+ protected DiagnosticsLogger $ logger ,
31
+ protected Emulation $ emulation ,
32
+ protected ScopeCodeResolver $ scopeCodeResolver ,
33
+ protected AlgoliaHelper $ algoliaHelper ,
34
+ protected ProductHelper $ productHelper ,
35
+ protected ResourceConnection $ resource ,
36
+ protected ManagerInterface $ eventManager ,
37
+ protected MissingPriceIndexHandler $ missingPriceIndexHandler ,
38
+ IndexerRegistry $ indexerRegistry
38
39
){
39
40
parent ::__construct ($ configHelper , $ logger , $ emulation , $ scopeCodeResolver , $ algoliaHelper );
40
41
@@ -106,12 +107,6 @@ public function buildIndex(int $storeId, ?array $entityIds, ?array $options): vo
106
107
*/
107
108
protected function rebuildEntityIds (int $ storeId , array $ productIds ): void
108
109
{
109
- if ($ this ->isIndexingEnabled ($ storeId ) === false ) {
110
- return ;
111
- }
112
-
113
- $ this ->checkPriceIndex ($ productIds );
114
-
115
110
$ this ->startEmulation ($ storeId );
116
111
$ this ->logger ->start ('Indexing ' );
117
112
try {
@@ -239,6 +234,11 @@ protected function buildIndexPage(
239
234
'store ' => $ storeId
240
235
]
241
236
);
237
+
238
+ if ($ this ->configHelper ->isAutoPriceIndexingEnabled ($ storeId )) {
239
+ $ this ->missingPriceIndexHandler ->refreshPriceIndex ($ collection );
240
+ }
241
+
242
242
$ logMessage = 'LOADING: ' . $ this ->logger ->getStoreName ($ storeId ) . ',
243
243
collection page: ' . $ page . ',
244
244
pageSize: ' . $ pageSize ;
0 commit comments