PHP Interface Smile\ElasticsuiteCore\Api\Index\Bulk\BulkRequestInterface

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

Public Methods

Method Description
addDocument ( Smile\ElasticsuiteCore\Api\Index\IndexInterface $index, Smile\ElasticsuiteCore\Api\Index\TypeInterface $type, string | integer $docId, array $data ) : Smile\ElasticsuiteCore\Api\Index\Bulk\BulkRequestInterface Add a single document to the index.
addDocuments ( Smile\ElasticsuiteCore\Api\Index\IndexInterface $index, Smile\ElasticsuiteCore\Api\Index\TypeInterface $type, array $data ) : Smile\ElasticsuiteCore\Api\Index\Bulk\BulkRequestInterface Add a several documents to the index.
deleteDocument ( Smile\ElasticsuiteCore\Api\Index\IndexInterface $index, Smile\ElasticsuiteCore\Api\Index\TypeInterface $type, string | integer $docId ) : Smile\ElasticsuiteCore\Api\Index\Bulk\BulkRequestInterface Delete a document from the index.
deleteDocuments ( Smile\ElasticsuiteCore\Api\Index\IndexInterface $index, Smile\ElasticsuiteCore\Api\Index\TypeInterface $type, array $docIds ) : Smile\ElasticsuiteCore\Api\Index\Bulk\BulkRequestInterface Delete multiple documents from the index.
getOperations ( ) : array Return list of operations to be executed as an array.
isEmpty ( ) : boolean Indicates if the current bulk contains operation.
updateDocument ( Smile\ElasticsuiteCore\Api\Index\IndexInterface $index, Smile\ElasticsuiteCore\Api\Index\TypeInterface $type, string | integer $docId, array $data ) : Smile\ElasticsuiteCore\Api\Index\Bulk\BulkRequestInterface Update a single document to the index.
updateDocuments ( Smile\ElasticsuiteCore\Api\Index\IndexInterface $index, Smile\ElasticsuiteCore\Api\Index\TypeInterface $type, array $data ) : Smile\ElasticsuiteCore\Api\Index\Bulk\BulkRequestInterface Update a several documents to the index.

Method Details

addDocument() public method

Add a single document to the index.
public addDocument ( Smile\ElasticsuiteCore\Api\Index\IndexInterface $index, Smile\ElasticsuiteCore\Api\Index\TypeInterface $type, string | integer $docId, array $data ) : Smile\ElasticsuiteCore\Api\Index\Bulk\BulkRequestInterface
$index Smile\ElasticsuiteCore\Api\Index\IndexInterface Index the document has to be added to.
$type Smile\ElasticsuiteCore\Api\Index\TypeInterface Document type.
$docId string | integer Document id.
$data array Document data.
return Smile\ElasticsuiteCore\Api\Index\Bulk\BulkRequestInterface

addDocuments() public method

$data format have to be an array of all documents with document id as key.
public addDocuments ( Smile\ElasticsuiteCore\Api\Index\IndexInterface $index, Smile\ElasticsuiteCore\Api\Index\TypeInterface $type, array $data ) : Smile\ElasticsuiteCore\Api\Index\Bulk\BulkRequestInterface
$index Smile\ElasticsuiteCore\Api\Index\IndexInterface Index the documents have to be added to.
$type Smile\ElasticsuiteCore\Api\Index\TypeInterface Document type.
$data array Document data.
return Smile\ElasticsuiteCore\Api\Index\Bulk\BulkRequestInterface

deleteDocument() public method

Delete a document from the index.
public deleteDocument ( Smile\ElasticsuiteCore\Api\Index\IndexInterface $index, Smile\ElasticsuiteCore\Api\Index\TypeInterface $type, string | integer $docId ) : Smile\ElasticsuiteCore\Api\Index\Bulk\BulkRequestInterface
$index Smile\ElasticsuiteCore\Api\Index\IndexInterface Index the document has to be delete from.
$type Smile\ElasticsuiteCore\Api\Index\TypeInterface Document type.
$docId string | integer Document id.
return Smile\ElasticsuiteCore\Api\Index\Bulk\BulkRequestInterface

deleteDocuments() public method

Delete multiple documents from the index.
public deleteDocuments ( Smile\ElasticsuiteCore\Api\Index\IndexInterface $index, Smile\ElasticsuiteCore\Api\Index\TypeInterface $type, array $docIds ) : Smile\ElasticsuiteCore\Api\Index\Bulk\BulkRequestInterface
$index Smile\ElasticsuiteCore\Api\Index\IndexInterface Index the document has to be delete from.
$type Smile\ElasticsuiteCore\Api\Index\TypeInterface Type of the documents to be delete.
$docIds array Ids of the deleted documents.
return Smile\ElasticsuiteCore\Api\Index\Bulk\BulkRequestInterface

getOperations() public method

Return list of operations to be executed as an array.
public getOperations ( ) : array
return array

isEmpty() public method

Indicates if the current bulk contains operation.
public isEmpty ( ) : boolean
return boolean

updateDocument() public method

Note : only updated fields are needed into data. Others fields are kept untouched by the update operation.
public updateDocument ( Smile\ElasticsuiteCore\Api\Index\IndexInterface $index, Smile\ElasticsuiteCore\Api\Index\TypeInterface $type, string | integer $docId, array $data ) : Smile\ElasticsuiteCore\Api\Index\Bulk\BulkRequestInterface
$index Smile\ElasticsuiteCore\Api\Index\IndexInterface Index the document has to be added to.
$type Smile\ElasticsuiteCore\Api\Index\TypeInterface Document type.
$docId string | integer Document id.
$data array Updated data.
return Smile\ElasticsuiteCore\Api\Index\Bulk\BulkRequestInterface Self reference.

updateDocuments() public method

$data format have to be an array of all documents update data with document id as key.
public updateDocuments ( Smile\ElasticsuiteCore\Api\Index\IndexInterface $index, Smile\ElasticsuiteCore\Api\Index\TypeInterface $type, array $data ) : Smile\ElasticsuiteCore\Api\Index\Bulk\BulkRequestInterface
$index Smile\ElasticsuiteCore\Api\Index\IndexInterface Index the documents have to be added to.
$type Smile\ElasticsuiteCore\Api\Index\TypeInterface Document type.
$data array Document data.
return Smile\ElasticsuiteCore\Api\Index\Bulk\BulkRequestInterface Self reference.