Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
EnableEavIndexer.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
9 
17 {
21  const SEARCH_ENGINE_VALUE_PATH = 'groups/search/fields/engine/value';
22 
26  public function beforeSave(\Magento\Config\Model\Config $subject)
27  {
28  $searchEngine = $subject->getData(self::SEARCH_ENGINE_VALUE_PATH);
29  if ($searchEngine === 'mysql') {
30  $data = $subject->getData();
31  $data['groups']['search']['fields']['enable_eav_indexer']['value'] = 1;
32 
33  $subject->setData($data);
34  }
35  }
36 }
beforeSave(\Magento\Config\Model\Config $subject)