PHP Interface Smile\ElasticsuiteCore\Api\Index\IndexOperationInterface

Author: Aurelien FOUCRET ([email protected])
Exibir arquivo Open project: smile-sa/elasticsuite Interface Usage Examples

Public Methods

Method Description
createBulk ( ) : Smile\ElasticsuiteCore\Api\Index\Bulk\BulkRequestInterface Create a new empty bulk.
createIndex ( string $indexIdentifier, integer | string | Magento\Store\Api\Data\StoreInterface $store ) : Smile\ElasticsuiteCore\Api\Index\IndexInterface Prepare a new index into ES from it's identifier (e.g.: catalog_product).
executeBulk ( Smile\ElasticsuiteCore\Api\Index\Bulk\BulkRequestInterface $bulk ) : Smile\ElasticsuiteCore\Api\Index\Bulk\BulkResponseInterface Execute a bulk and return the execution response.
getBatchIndexingSize ( ) : integer Returns batch indexing size.
getIndexByName ( string $indexIdentifier, integer | string | Magento\Store\Api\Data\StoreInterface $store ) : Smile\ElasticsuiteCore\Api\Index\IndexInterface Returns an index by it's identifier (e.g.: catalog_product) and by store.
indexExists ( string $indexIdentifier, integer | string | Magento\Store\Api\Data\StoreInterface $store ) : boolean Check if an index exists using it's identifier (e.g.: catalog_product) and by store.
installIndex ( Smile\ElasticsuiteCore\Api\Index\IndexInterface $index, integer | string | Magento\Store\Api\Data\StoreInterface $store ) : Smile\ElasticsuiteCore\Api\Index\IndexInterface Switch the alias to the installed index and delete the old index.
isAvailable ( ) : boolean Check if the ES service is available.
proceedIndexInstall ( string $indexName, string $indexAlias ) : void Proceed to the indices install :
refreshIndex ( Smile\ElasticsuiteCore\Api\Index\IndexInterface $index ) : Smile\ElasticsuiteCore\Api\Index\IndexOperationInterface Refresh an index (should be called after indexing operations to ensure data are available for search).

Method Details

createBulk() public method

Create a new empty bulk.
public createBulk ( ) : Smile\ElasticsuiteCore\Api\Index\Bulk\BulkRequestInterface
return Smile\ElasticsuiteCore\Api\Index\Bulk\BulkRequestInterface

createIndex() public method

The index is created with a horodated name prefixed by the alias (eg.: magento2_catalog_product_2060201_122145).
public createIndex ( 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

executeBulk() public method

Execute a bulk and return the execution response.
public executeBulk ( Smile\ElasticsuiteCore\Api\Index\Bulk\BulkRequestInterface $bulk ) : Smile\ElasticsuiteCore\Api\Index\Bulk\BulkResponseInterface
$bulk Smile\ElasticsuiteCore\Api\Index\Bulk\BulkRequestInterface Bulk to be executed.
return Smile\ElasticsuiteCore\Api\Index\Bulk\BulkResponseInterface

getBatchIndexingSize() public method

Returns batch indexing size.
public getBatchIndexingSize ( ) : integer
return integer

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

indexExists() public method

Check if an index exists using it's identifier (e.g.: catalog_product) and by store.
public indexExists ( string $indexIdentifier, integer | string | Magento\Store\Api\Data\StoreInterface $store ) : boolean
$indexIdentifier string Index identifier.
$store integer | string | Magento\Store\Api\Data\StoreInterface Store (id, identifier or object).
return boolean

installIndex() public method

Switch the alias to the installed index and delete the old index.
public installIndex ( Smile\ElasticsuiteCore\Api\Index\IndexInterface $index, integer | string | Magento\Store\Api\Data\StoreInterface $store ) : Smile\ElasticsuiteCore\Api\Index\IndexInterface
$index Smile\ElasticsuiteCore\Api\Index\IndexInterface Installed index.
$store integer | string | Magento\Store\Api\Data\StoreInterface Store (id, identifier or object).
return Smile\ElasticsuiteCore\Api\Index\IndexInterface

isAvailable() public method

Check if the ES service is available.
public isAvailable ( ) : boolean
return boolean

proceedIndexInstall() public method

1) First switch the alias to the new index 2) Remove old indices
public proceedIndexInstall ( string $indexName, string $indexAlias ) : void
$indexName string Real index name.
$indexAlias string Index alias (must include store identifier).
return void

refreshIndex() public method

Refresh an index (should be called after indexing operations to ensure data are available for search).
public refreshIndex ( Smile\ElasticsuiteCore\Api\Index\IndexInterface $index ) : Smile\ElasticsuiteCore\Api\Index\IndexOperationInterface
$index Smile\ElasticsuiteCore\Api\Index\IndexInterface Index
return Smile\ElasticsuiteCore\Api\Index\IndexOperationInterface