PHP Interface Smile\ElasticsuiteCore\Api\Index\IndexOperationInterface

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

Méthodes publiques

Méthode 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 méthode

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

createIndex() public méthode

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).
Résultat Smile\ElasticsuiteCore\Api\Index\IndexInterface

executeBulk() public méthode

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.
Résultat Smile\ElasticsuiteCore\Api\Index\Bulk\BulkResponseInterface

getBatchIndexingSize() public méthode

Returns batch indexing size.
public getBatchIndexingSize ( ) : integer
Résultat integer

getIndexByName() public méthode

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).
Résultat Smile\ElasticsuiteCore\Api\Index\IndexInterface

indexExists() public méthode

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).
Résultat boolean

installIndex() public méthode

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).
Résultat Smile\ElasticsuiteCore\Api\Index\IndexInterface

isAvailable() public méthode

Check if the ES service is available.
public isAvailable ( ) : boolean
Résultat boolean

proceedIndexInstall() public méthode

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).
Résultat void

refreshIndex() public méthode

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
Résultat Smile\ElasticsuiteCore\Api\Index\IndexOperationInterface