Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
SearchIndexNameResolver.php
Go to the documentation of this file.
1 <?php
7 
10 
17 {
21  private $clientConfig;
22 
26  public function __construct(
27  Config $clientConfig
28  ) {
29  $this->clientConfig = $clientConfig;
30  }
31 
40  public function getIndexName($storeId, $indexerId)
41  {
42  $mappedIndexerId = $this->getIndexMapping($indexerId);
43  return $this->clientConfig->getIndexPrefix() . '_' . $mappedIndexerId . '_' . $storeId;
44  }
45 
52  private function getIndexMapping($indexerId)
53  {
54  if ($indexerId == Fulltext::INDEXER_ID) {
55  $mappedIndexerId = 'product';
56  } else {
57  $mappedIndexerId = $indexerId;
58  }
59  return $mappedIndexerId;
60  }
61 }