Smile\ElasticsuiteCore\Api\Index\IndexOperationInterface::getIndexByName PHP Method

getIndexByName() public method

If the index does not exists into ES a \LogicalException is thrown.
public getIndexByName ( string $indexIdentifier, integer | string | Magento\Store\Api\Data\StoreInterface $store ) : Smile\ElasticsuiteCore\Api\Index\IndexInterface
$indexIdentifier string Index identifier.
$store integer | string | Magento\Store\Api\Data\StoreInterface Store (id, identifier or object).
return Smile\ElasticsuiteCore\Api\Index\IndexInterface
    public function getIndexByName($indexIdentifier, $store);

Usage Example

Example #1
0
 /**
  * Retrieve the search engine mapping.
  *
  * @return MappingInterface
  */
 private function getMapping()
 {
     if ($this->mapping === null) {
         $defaultStore = $this->storeManager->getDefaultStoreView();
         $index = $this->indexManager->getIndexByName($this->indexName, $defaultStore);
         $this->mapping = $index->getType($this->typeName)->getMapping();
     }
     return $this->mapping;
 }
All Usage Examples Of Smile\ElasticsuiteCore\Api\Index\IndexOperationInterface::getIndexByName