Smile\ElasticsuiteCore\Helper\Cache::cleanIndexCache PHP Method

cleanIndexCache() public method

Clean the cache by index identifier and store.
public cleanIndexCache ( string $indexIdentifier, string $storeId ) : void
$indexIdentifier string Index identifier.
$storeId string Store id.
return void
    public function cleanIndexCache($indexIdentifier, $storeId)
    {
        $cacheTags = $this->getCacheTags($indexIdentifier, $storeId);
        $this->cache->clean($cacheTags);
    }

Usage Example

Example #1
0
 /**
  * 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);
 }
All Usage Examples Of Smile\ElasticsuiteCore\Helper\Cache::cleanIndexCache