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

$_data

$_data : \Elastica\Document|\Elastica\Script\AbstractScript

Type

\Elastica\Document|\Elastica\Script\AbstractScript

Methods

__construct()

__construct(\Elastica\Document|\Elastica\Script\AbstractScript  $document) 

Parameters

\Elastica\Document|\Elastica\Script\AbstractScript $document

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|string  $source) : $this

Parameters

array|string $source

Returns

$this

getSource()

getSource() : array|string

Returns

array|string

hasSource()

hasSource() : boolean

Returns

boolean

setIndex()

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

Parameters

string|\Elastica\Index $index

Returns

$this

setId()

setId(string  $id) : $this

Parameters

string $id

Returns

$this

setRouting()

setRouting(string|integer  $routing) : $this

Parameters

string|integer $routing

Returns

$this

toArray()

toArray() : array

Returns

array

toString()

toString() : string

Returns

string

isValidOpType()

isValidOpType(string|null  $opType = null) : boolean

Parameters

string|null $opType

Returns

boolean

setDocument()

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

Parameters

\Elastica\Document $document

Returns

$this

setScript()

setScript(\Elastica\Script\AbstractScript  $script) : $this

Parameters

\Elastica\Script\AbstractScript $script

Returns

$this

setData()

setData(\Elastica\Script\AbstractScript|\Elastica\Document  $data) : $this

Parameters

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

Throws

\InvalidArgumentException

Returns

$this

getDocument()

getDocument() : \Elastica\Document|null

Note: This is for backwards compatibility.

Returns

\Elastica\Document|null

getScript()

getScript() : \Elastica\Script\AbstractScript|null

Note: This is for backwards compatibility.

Returns

\Elastica\Script\AbstractScript|null

getData()

getData() : \Elastica\Document|\Elastica\Script\AbstractScript

Returns

\Elastica\Document|\Elastica\Script\AbstractScript

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

_getMetadata()

_getMetadata(\Elastica\AbstractUpdateAction  $source) : array

Parameters

\Elastica\AbstractUpdateAction $source

Returns

array