用途:指定主键ID获得数据详情
依赖类:\x\Elasticsearch
方法名:get()
参数:
string|int $id
id()
方法传入的主键ID值。null
返回值:失败返回false
,成功返回数据集
使用示例:
$Elasticsearch = new \x\Elasticsearch();
// 场景:直接传入ID
$Elasticsearch->table('shop')->get(1);
// 场景:也可以通过id()方法传入
$Elasticsearch->table('shop')->id(1)->get();
注意:该方法仅支持使用主键进行单条读取。