作者 邓超

es

... ... @@ -543,7 +543,14 @@ class MailListV2Es extends Base {
private function countFlagged($body){
$body['query']['bool']['must'][] = ['term'=>['flagged'=>1]];
$body['query']['bool']['must'][] = $this->assignSql2();
return $this->es->count($body);
return $this->es->count($body,['aggs' => [
'unique_udate' => [
'terms' => [
'field' => 'udate', // 替换为你的字段名称
'size' => 500 // 设置返回的去重值的数量
]
]
]]);
}
}
... ...
... ... @@ -94,13 +94,17 @@ class Es {
* @author:dc
* @time 2025/3/4 9:47
*/
public function count(array $body){
public function count(array $body,$other=[]){
$params = [
'index' => $this->getIndex(),
'body' => $body
];
if($other){
$params = array_merge($params,$other);
}
try {
$response = $this->client->count($params);
}catch (\Throwable $e) {
... ...