This class implements the ActiveRecord pattern for the fulltext search and data storage
elasticsearch.
For defining a record a subclass should at least implement the ActiveRecord::attributes method to define
attributes.
The primary key (the _id field in elasticsearch terms) is represented by getId() and setId().
The primary key is not part of the attributes.
The following is an example model called Customer:
php
class Customer extends \yii\elasticsearch\ActiveRecord
{
public function attributes()
{
return ['id', 'name', 'address', 'registration_date'];
}
}
You may override ActiveRecord::index and ActiveRecord::type to define the index and type this record represents.