Constants

OP_TYPE_CREATE

OP_TYPE_CREATE

OP_TYPE_INDEX

OP_TYPE_INDEX

OP_TYPE_DELETE

OP_TYPE_DELETE

OP_TYPE_UPDATE

OP_TYPE_UPDATE

Properties

$opTypes

$opTypes : array

Type

array

$_opType

$_opType : string

Type

string

$_metadata

$_metadata : array

Type

array

$_source

$_source : array

Type

array

Methods

setDocument()

setDocument(\Elastica\Document  $document) : $this

Parameters

\Elastica\Document $document

Returns

$this

__construct()

__construct(string  $opType = self::OP_TYPE_INDEX, array  $metadata = array(), array  $source = array()) 

Parameters

string $opType
array $metadata
array $source

getDocument()

getDocument() : \Elastica\Document|null

Note: This is for backwards compatibility.

Returns

\Elastica\Document|null

create()

create(\Elastica\Document|\Elastica\Script\AbstractScript  $data, string  $opType = null) : static

Creates a bulk action for a document or a script.

The action can be index, update, create or delete based on the $opType param (by default index).

Parameters

\Elastica\Document|\Elastica\Script\AbstractScript $data
string $opType

Returns

static

setOpType()

setOpType(string  $type) : $this

Parameters

string $type

Returns

$this

getOpType()

getOpType() : string

Returns

string

setMetadata()

setMetadata(array  $metadata) : $this

Parameters

array $metadata

Returns

$this

getMetadata()

getMetadata() : array

Returns

array

getActionMetadata()

getActionMetadata() : array

Returns

array

setSource()

setSource(array  $source) : $this

Parameters

array $source

Returns

$this

getSource()

getSource() : array

Returns

array

hasSource()

hasSource() : boolean

Returns

boolean

setIndex()

setIndex(string|\Elastica\Index  $index) : $this

Parameters

string|\Elastica\Index $index

Returns

$this

setType()

setType(string|\Elastica\Type  $type) : $this

Parameters

string|\Elastica\Type $type

Returns

$this

setId()

setId(string  $id) : $this

Parameters

string $id

Returns

$this

setRouting()

setRouting(string  $routing) : $this

Parameters

string $routing

Returns

$this

toArray()

toArray() : array

Returns

array

toString()

toString() : string

Returns

string

isValidOpType()

isValidOpType(string  $opType) : boolean

Parameters

string $opType

Returns

boolean