PHP Class yii\elasticsearch\BulkCommand

Further details on bulk API is available in elasticsearch guide.
Since: 2.0.5
Author: Konstantin Sirotkin ([email protected])
Inheritance: extends yii\base\Component
Datei anzeigen Open project: yiisoft/yii2-elasticsearch

Public Properties

Property Type Description
$actions Actions to be executed in this bulk command, given as either an array of arrays or as one newline-delimited string. All actions except delete span two lines.
$db Connection
$index Default index to execute the queries on. Defaults to null meaning that index needs to be specified in every action.
$options Options to be appended to the query URL.
$type Default type to execute the queries on. Defaults to null meaning that type needs to be specified in every action.

Public Methods

Method Description
addAction ( $line1, $line2 = null ) Adds an action to the command. Will overwrite existing actions if they are specified as a string.
addDeleteAction ( string $id, string $index = null, string $type = null ) Adds a delete action to the command.
execute ( ) : mixed Executes the bulk command.

Method Details

addAction() public method

Adds an action to the command. Will overwrite existing actions if they are specified as a string.
public addAction ( $line1, $line2 = null )

addDeleteAction() public method

Adds a delete action to the command.
public addDeleteAction ( string $id, string $index = null, string $type = null )
$id string Document ID
$index string Index that the document belogs to. Can be set to null if the command has a default index ([[BulkCommand::$index]]) assigned.
$type string Type that the document belogs to. Can be set to null if the command has a default type ([[BulkCommand::$type]]) assigned.

execute() public method

Executes the bulk command.
public execute ( ) : mixed
return mixed

Property Details

$actions public_oe property

Actions to be executed in this bulk command, given as either an array of arrays or as one newline-delimited string. All actions except delete span two lines.
public $actions

$db public_oe property

public Connection,yii\elasticsearch $db
return Connection

$index public_oe property

Default index to execute the queries on. Defaults to null meaning that index needs to be specified in every action.
public $index

$options public_oe property

Options to be appended to the query URL.
public $options

$type public_oe property

Default type to execute the queries on. Defaults to null meaning that type needs to be specified in every action.
public $type