Smile\ElasticsuiteCore\Index\IndexOperation::initIndex PHP Method

initIndex() private method

private initIndex ( string $indexIdentifier, integer | string | Magento\Store\Api\Data\StoreInterface $store, boolean $existingIndex ) : Smile\ElasticsuiteCore\Api\Index\IndexInterface;
$indexIdentifier string An index indentifier.
$store integer | string | Magento\Store\Api\Data\StoreInterface The store.
$existingIndex boolean Is the index already existing.
return Smile\ElasticsuiteCore\Api\Index\IndexInterface;
    private function initIndex($indexIdentifier, $store, $existingIndex)
    {
        if (!isset($this->indicesConfiguration[$indexIdentifier])) {
            throw new \LogicException("No index found with identifier {$indexIdentifier} into elasticsuite_indices.xml");
        }
        $indexSettings = $this->indexSettings;
        $indexAlias = $indexSettings->getIndexAliasFromIdentifier($indexIdentifier, $store);
        $indexName = $indexSettings->createIndexNameFromIdentifier($indexIdentifier, $store);
        $needInstall = !$existingIndex;
        if ($existingIndex) {
            $indexName = $indexAlias;
        }
        $createIndexParams = ['identifier' => $indexIdentifier, 'name' => $indexName, 'needInstall' => $needInstall];
        $createIndexParams += $this->indicesConfiguration[$indexIdentifier];
        $index = $this->objectManager->create('\\Smile\\ElasticsuiteCore\\Api\\Index\\IndexInterface', $createIndexParams);
        $this->indicesByIdentifier[$indexAlias] = $index;
        return $this->indicesByIdentifier[$indexAlias];
    }