用途:根据查询条件,获得某个字段的最小值
依赖类:\x\Elasticsearch
方法名:min()
参数:
string $field
返回值:this
,需要结合aggs()
方法运行。
使用示例:
$Elasticsearch = new \x\Elasticsearch();
$where = [
['title', '=', '骑士队', 'must'],
['title', '=', '利夫兰', 'filter'],
];
$res = $Elasticsearch->table('shop')->where($where)->min('age')->aggs();
var_dump($res);