6
6
7
7
namespace Magento \CatalogSearch \Model \Indexer ;
8
8
9
- use Magento \Catalog \Model \Product ;
10
9
use Magento \CatalogSearch \Model \Indexer \Fulltext \Action \FullFactory ;
11
10
use Magento \CatalogSearch \Model \Indexer \Scope \State ;
12
11
use Magento \CatalogSearch \Model \Indexer \Scope \StateFactory ;
13
12
use Magento \CatalogSearch \Model \ResourceModel \Fulltext as FulltextResource ;
14
13
use Magento \Framework \App \ObjectManager ;
15
- use Magento \Framework \Indexer \CacheContext ;
16
14
use Magento \Framework \Indexer \DimensionProviderInterface ;
17
15
use Magento \Store \Model \StoreDimensionProvider ;
18
16
use Magento \Indexer \Model \ProcessManager ;
@@ -79,11 +77,6 @@ class Fulltext implements
79
77
*/
80
78
private $ processManager ;
81
79
82
- /**
83
- * @var CacheContext
84
- */
85
- private $ cacheContext ;
86
-
87
80
/**
88
81
* @param FullFactory $fullActionFactory
89
82
* @param IndexerHandlerFactory $indexerHandlerFactory
@@ -93,7 +86,6 @@ class Fulltext implements
93
86
* @param DimensionProviderInterface $dimensionProvider
94
87
* @param array $data
95
88
* @param ProcessManager $processManager
96
- * @param CacheContext|null $cacheContext
97
89
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
98
90
*/
99
91
public function __construct (
@@ -104,8 +96,7 @@ public function __construct(
104
96
StateFactory $ indexScopeStateFactory ,
105
97
DimensionProviderInterface $ dimensionProvider ,
106
98
array $ data ,
107
- ProcessManager $ processManager = null ,
108
- CacheContext $ cacheContext = null
99
+ ProcessManager $ processManager = null
109
100
) {
110
101
$ this ->fullAction = $ fullActionFactory ->create (['data ' => $ data ]);
111
102
$ this ->indexerHandlerFactory = $ indexerHandlerFactory ;
@@ -115,7 +106,6 @@ public function __construct(
115
106
$ this ->indexScopeState = ObjectManager::getInstance ()->get (State::class);
116
107
$ this ->dimensionProvider = $ dimensionProvider ;
117
108
$ this ->processManager = $ processManager ?: ObjectManager::getInstance ()->get (ProcessManager::class);
118
- $ this ->cacheContext = $ cacheContext ?? ObjectManager::getInstance ()->get (CacheContext::class);
119
109
}
120
110
121
111
/**
@@ -155,8 +145,6 @@ public function executeByDimensions(array $dimensions, \Traversable $entityIds =
155
145
$ saveHandler ->saveIndex ($ dimensions , $ this ->fullAction ->rebuildStoreIndex ($ storeId ));
156
146
157
147
$ this ->fulltextResource ->resetSearchResultsByStore ($ storeId );
158
-
159
- $ this ->cacheContext ->registerTags ([Product::CACHE_TAG ]);
160
148
} else {
161
149
// internal implementation works only with array
162
150
$ entityIds = iterator_to_array ($ entityIds );
@@ -167,8 +155,6 @@ public function executeByDimensions(array $dimensions, \Traversable $entityIds =
167
155
$ saveHandler ->deleteIndex ($ dimensions , new \ArrayIterator ($ productIds ));
168
156
$ saveHandler ->saveIndex ($ dimensions , $ this ->fullAction ->rebuildStoreIndex ($ storeId , $ productIds ));
169
157
}
170
-
171
- $ this ->cacheContext ->registerEntities (Product::CACHE_TAG , $ productIds );
172
158
}
173
159
}
174
160
0 commit comments