PHP Class Elasticsearch\Bulk

Show file Open project: nervetattoo/elasticsearch Class Usage Examples

Public Methods

Method Description
__construct ( elasticsearch\Client $client ) Construct a bulk operation
commit ( ) commit this operation
count ( ) : integer count all pending operations
createPayload ( ) : string create a request payload with all pending operations
delete ( mixed $id = false, string $index, string $type, array $options = [] ) : Bulk delete a document
getOperations ( ) : array get all pending operations
index ( array $document, mixed $id = null, string $index, string $type, array $options = [] ) : Bulk Index a new document or update it if existing
reset ( ) reset this operation
update ( array $partialDocument, mixed $id, string $index, string $type, array $options = [] ) : Bulk Update a part of a document

Method Details

__construct() public method

Construct a bulk operation
public __construct ( elasticsearch\Client $client )
$client elasticsearch\Client

commit() public method

commit this operation
public commit ( )

count() public method

count all pending operations
public count ( ) : integer
return integer

createPayload() public method

create a request payload with all pending operations
public createPayload ( ) : string
return string

delete() public method

delete a document
public delete ( mixed $id = false, string $index, string $type, array $options = [] ) : Bulk
$id mixed
$index string Index
$type string Type
$options array Parameters to pass to delete action
return Bulk

getOperations() public method

get all pending operations
public getOperations ( ) : array
return array

index() public method

Index a new document or update it if existing
public index ( array $document, mixed $id = null, string $index, string $type, array $options = [] ) : Bulk
$document array
$id mixed Optional
$index string Index
$type string Type
$options array Allow sending query parameters to control indexing further _refresh_ *bool* If set to true, immediately refresh the shard after indexing
return Bulk

reset() public method

reset this operation
public reset ( )

update() public method

Update a part of a document
public update ( array $partialDocument, mixed $id, string $index, string $type, array $options = [] ) : Bulk
$partialDocument array
$id mixed
$index string Index
$type string Type
$options array Allow sending query parameters to control indexing further _refresh_ *bool* If set to true, immediately refresh the shard after indexing
return Bulk