getIndexAliasFromIdentifier() public method

Returns the index alias for an identifier (eg. catalog_product) by store.
public getIndexAliasFromIdentifier ( string $indexIdentifier, integer | string | Magento\Store\Api\Data\StoreInterface $store ) : string
$indexIdentifier string Index identifier.
$store integer | string | Magento\Store\Api\Data\StoreInterface Store.
return string
Example #1
0
 /**
  * {@inheritDoc}
  */
 public function installIndex(IndexInterface $index, $store)
 {
     if ($index->needInstall()) {
         $indexIdentifier = $index->getIdentifier();
         $indexName = $index->getName();
         $indexAlias = $this->indexSettings->getIndexAliasFromIdentifier($indexIdentifier, $store);
         $this->client->indices()->optimize(['index' => $indexName]);
         $this->client->indices()->putSettings(['index' => $indexName, 'body' => $this->indexSettings->getInstallIndexSettings()]);
         $this->proceedIndexInstall($indexName, $indexAlias);
     }
     return $index;
 }