This method defines the attribute that uniquely identifies a record.
The name of the primary key attribute is _id
, and can not be changed.
Elasticsearch does not support composite primary keys in the traditional sense. However to match the signature of the ActiveRecordInterface this methods returns an array instead of a single string.
public static string[] primaryKey ( ) | ||
return | string[] |
Array of primary key attributes. Only the first element of the array will be used. |
---|
final public static function primaryKey()
{
return ['_id'];
}