Create a new index for an identifier (eg. catalog_product) by store including current date.
/** * 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 createIndexNameFromIdentifier($indexIdentifier, $store) { return $this->helper->createIndexNameFromIdentifier($indexIdentifier, $store); }