elasticsearch\ActiveQuery EVENT_INIT

EVENT_INIT event of type \yii\elasticsearch\Event An event that is triggered when the query is initialized via init().

elasticsearch\ActiveQuery createCommand()

createCommand() public method Creates a DB command that can be used to execute this query. public yii\elasticsearch\Command createCommand ( $db = null )$db yii\elasticsearch\Connection The DB connection used to create the DB command. If null, the DB connection returned by $modelClass will be used. return yii\elasticsearch\Command The created DB command instance.

elasticsearch\ActiveQuery column()

column() public method Executes the query and returns the first column of the result. public array column ( $field, $db = null )$field string The field to query over $db yii\elasticsearch\Connection The database connection used to execute the query. If this parameter is not given, the elasticsearch application component will be used. return array The first column of the query result. An empty array is returned if the query results in nothing.

elasticsearch\ActiveQuery all()

all() public method Executes query and returns all results as an array. public array all ( $db = null )$db yii\elasticsearch\Connection The DB connection used to create the DB command. If null, the DB connection returned by $modelClass will be used. return array The query results. If the query results in nothing, an empty array will be returned.

elasticsearch\ActiveFixture resetIndex()

resetIndex() protected method Removes all existing data from the specified index and type. This method is called before populating fixture data into the index associated with this fixture. protected void resetIndex ( )

elasticsearch\ActiveFixture load()

load() public method Loads the fixture. The default implementation will first clean up the index by calling resetIndex(). It will then populate the index with the data returned by getData(). If you override this method, you should consider calling the parent implementation so that the data returned by getData() can be populated into the index. public void load ( )

elasticsearch\ActiveFixture init()

init() public method Initializes the object. This method is invoked at the end of the constructor after the object is initialized with the given configuration. public void init ( )

elasticsearch\ActiveFixture getData()

getData() protected method Returns the fixture data. The default implementation will try to return the fixture data by including the external file specified by $dataFile. The file should return an array of data rows (column name => column value), each corresponding to a row in the index. If the data file does not exist, an empty array will be returned. protected array getData ( )return array The data rows to be inserted into the database index.

elasticsearch\ActiveFixture $type

$type public property The name of the type that this fixture is about. If this property is not set, the name will be determined via $modelClass. See also $modelClass. public string $type = null

elasticsearch\ActiveFixture $index

$index public property The name of the index that this fixture is about. If this property is not set, the name will be determined via $modelClass. See also $modelClass. public string $index = null