Returns the index alias for an identifier (eg. catalog_product) by store.
/** * Create the synonyms index for a store id. * * @param integer $storeId Store id. * @param string[] $synonyms Raw synonyms list. * @param string[] $expansions Raw expansions list. * * @return void */ public function reindex($storeId, $synonyms, $expansions) { $indexIdentifier = ThesaurusIndex::INDEX_IDENTIER; $indexName = $this->indexSettingsHelper->createIndexNameFromIdentifier($indexIdentifier, $storeId); $indexAlias = $this->indexSettingsHelper->getIndexAliasFromIdentifier($indexIdentifier, $storeId); $indexSettings = ['settings' => $this->getIndexSettings($synonyms, $expansions)]; $this->client->indices()->create(['index' => $indexName, 'body' => $indexSettings]); $this->indexManager->proceedIndexInstall($indexName, $indexAlias); $this->cacheHelper->cleanIndexCache(ThesaurusIndex::INDEX_IDENTIER, $storeId); }
/** * {@inheritDoc} */ public function getIndexAliasFromIdentifier($indexIdentifier, $store) { return $this->helper->getIndexAliasFromIdentifier($indexIdentifier, $store); }
/** * Get cache tag by index identifier / store. * * @param string $indexIdentifier Index identifier. * @param string $storeId Store id. * * @return string[] */ private function getCacheTags($indexIdentifier, $storeId) { return [$this->indexSettingsHelper->getIndexAliasFromIdentifier($indexIdentifier, $storeId)]; }
/** * Returns the index alias used by store id. * * @param integer $storeId Store id. * * @return string */ private function getIndexAlias($storeId) { return $this->indexSettingsHelper->getIndexAliasFromIdentifier(self::INDEX_IDENTIER, $storeId); }