Elasticsearch 统计某字段有值的文档数
$EsModel = new EsModel();
$protcountParams['index'] = $index;
$protcountParams['type'] = 'ips';
$protcountParams['from'] = 0;
$protcountParams['size'] = 0;
$protcountParams['body']['query'] = $search;
$protcountParams['body']['aggs']['age_count']['value_count'] = array('field'=>"port_c");
$port_info = $EsModel->search($protcountParams);
var_dump($port_info["aggregations"]["age_count"]["value"]);exit;
本作品采用《CC 协议》,转载必须注明作者和本文链接
推荐文章: