elasticsearch\ActiveRecord primaryKeysByCondition()

primaryKeysByCondition() protected static method (available since version 2.0.4) Performs a quick and highly efficient scroll/scan query to get the list of primary keys that satisfy the given condition. If condition is a list of primary keys (e.g.: ['_id' => ['1', '2', '3']]), the query is not performed for performance considerations. See also: updateAll() updateAllCounters() deleteAll() protected static array primaryKeysByCondition ( $condition )$condition array Please refer to yii\e

elasticsearch\ActiveRecord primaryKey()

primaryKey() public static method This method defines the attribute that uniquely identifies a record. The primaryKey for elasticsearch documents is the _id field by default. This field is not part of the ActiveRecord attributes so you should never add _id to the list of attributes. You may override this method to define the primary key name when you have defined path mapping for the _id field so that it is part of the _source and thus part of the attributes. Note that elasticsearch only su

elasticsearch\ActiveRecord populateRecord()

populateRecord() public static method Populates an active record object using a row of data from the database/storage. This is an internal method meant to be called to create active record objects after fetching data from the database. It is mainly used by yii\elasticsearch\ActiveQuery to populate the query results into active records. When calling this method manually you should call afterFind() on the created record to trigger the afterFind Event. public static void populateRecord ( $re

elasticsearch\ActiveRecord optimisticLock()

optimisticLock() public method This method has no effect in Elasticsearch ActiveRecord. Elasticsearch ActiveRecord uses native Optimistic locking. See update() for more details. public void optimisticLock ( )

elasticsearch\ActiveRecord mget()

mget() public static method Gets a list of records by its primary keys. public static array mget ( array $primaryKeys, $options = [] )$primaryKeys array An array of primaryKey values $options array Options given in this parameter are passed to elasticsearch as request URI parameters. Please refer to the elasticsearch documentation for more details on these options. return array The record instances, or empty array if nothing was found

elasticsearch\ActiveRecord instantiate()

instantiate() public static method Creates an active record instance. This method is called together with populateRecord() by yii\elasticsearch\ActiveQuery. It is not meant to be used for creating new records directly. You may override this method if the instance being created depends on the row data to be populated into the record. For example, by creating a record based on the value of a column, you may implement the so-called single-table inheritance mapping. public static static insta

elasticsearch\ActiveRecord insert()

insert() public method Inserts a document into the associated index using the attribute values of this record. This method performs the following steps in order: call beforeValidate() when $runValidation is true. If validation fails, it will skip the rest of the steps; call afterValidate() when $runValidation is true. call beforeSave(). If the method returns false, it will skip the rest of the steps; insert the record into database. If this fails, it will skip the rest of the steps; call af

elasticsearch\ActiveRecord index()

index() public static method public static string index ( )return string The name of the index this record is stored in.

elasticsearch\ActiveRecord getScore()

getScore() public method public float getScore ( )return float Returns the score of this record when it was retrieved via a find() query.

elasticsearch\ActiveRecord getPrimaryKey()

getPrimaryKey() public method Returns the primary key value(s). public mixed getPrimaryKey ( $asArray = false )$asArray boolean Whether to return the primary key value as an array. If true, the return value will be an array with column names as keys and column values as values. Note that for composite primary keys, an array will always be returned regardless of this parameter value. return mixed The primary key value. An array (column name => column value) is returned if the primary