Elasticsearch 統計某欄位有值的文件數

Vckin發表於2019-03-27
$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 協議》,轉載必須註明作者和本文連結

相關文章