File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
app/code/Magento/CatalogSearch/Model/ResourceModel/Search Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -211,11 +211,25 @@ private function prepareIndexEnforcements() : array
211
211
$ result = [];
212
212
foreach (self ::INDEX_USAGE_ENFORCEMENTS as $ table => $ index ) {
213
213
$ table = $ this ->getTable ($ table );
214
- $ result [$ table ] = $ index ;
214
+ if ($ this ->isIndexExists ($ table , $ index )) {
215
+ $ result [$ table ] = $ index ;
216
+ }
215
217
}
216
218
return $ result ;
217
219
}
218
220
221
+ /**
222
+ * Check if index exists in the table
223
+ *
224
+ * @param string $table
225
+ * @param string $index
226
+ * @return bool
227
+ */
228
+ private function isIndexExists (string $ table , string $ index ) : bool
229
+ {
230
+ return array_key_exists ($ index , $ this ->_conn ->getIndexList ($ table ));
231
+ }
232
+
219
233
/**
220
234
* Retrieve SQL for search entities
221
235
*
You can’t perform that action at this time.
0 commit comments