public function createIndexIfNotExists(\Smile\ElasticsuiteCore\Api\Index\IndexInterface $index, $store)
    {
        if ($this->client->indexExists($index->getName()) === false) {
            $indexSettings = array_merge($this->indexSettings->getCreateIndexSettings(), $this->indexSettings->getInstallIndexSettings());
            $indexSettings['analysis'] = $this->indexSettings->getAnalysisSettings($store);
            $this->client->createIndex($index->getName(), $indexSettings);
            $this->client->updateAliases([['add' => ['index' => $index->getName(), 'alias' => $index->getIdentifier()]]]);
            foreach ($index->getTypes() as $currentType) {
                $this->client->putMapping($index->getName(), $currentType->getName(), $currentType->getMapping()->asArray());
            }
        }
    }
public function createIndexIfNotExists(\Smile\ElasticsuiteCore\Api\Index\IndexInterface $index, $store)
    {
        if ($this->client->indexExists($index->getName()) === false) {
            $indexSettings = array_merge($this->indexSettings->getCreateIndexSettings(), $this->indexSettings->getInstallIndexSettings());
            $indexSettings['analysis'] = $this->indexSettings->getAnalysisSettings($store);
            $this->client->createIndex($index->getName(), $indexSettings);
            $this->client->updateAliases([['add' => ['index' => $index->getName(), 'alias' => $index->getIdentifier()]]]);
            foreach ($index->getTypes() as $currentType) {
                $this->client->putMapping($index->getName(), $currentType->getName(), $currentType->getMapping()->asArray());
            }
        }
    }
public function createIndexIfNotExists ( \ Smile \ ElasticsuiteCore \ Api \ Index \ IndexInterface $ index , $ store ) { if ( $ this -> client -> indexExists ( $ index -> getName ( ) ) === false ) { $ indexSettings = array_merge ( $ this -> indexSettings -> getCreateIndexSettings ( ) , $ this -> indexSettings -> getInstallIndexSettings ( ) ) ; $ indexSettings [ 'analysis' ] = $ this -> indexSettings -> getAnalysisSettings ( $ store ) ; $ this -> client -> createIndex ( $ index -> getName ( ) , $ indexSettings ) ; $ this -> client -> updateAliases ( [ [ 'add' => [ 'index' => $ index -> getName ( ) , 'alias' => $ index -> getIdentifier ( ) ] ] ] ) ; foreach ( $ index -> getTypes ( ) as $ currentType ) { $ this -> client -> putMapping ( $ index -> getName ( ) , $ currentType -> getName ( ) , $ currentType -> getMapping ( ) -> asArray ( ) ) ; } } }
Create an event index if not exists.

@param \Smile\ElasticsuiteCore\Api\Index\IndexInterface $index Index.
@param int                                              $store Store id.

@return void
Create an event index if not exists .