...
|
...
|
@@ -486,6 +486,42 @@ class MailListV2Es2 extends Base { |
|
|
return $this->es->count($body);
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
*
|
|
|
*/
|
|
|
public function search(){
|
|
|
$postid = app()->request('postid',0);
|
|
|
$email = app()->request('email');
|
|
|
$udate = app()->request('udate');
|
|
|
if(!is_numeric($udate)){
|
|
|
$udate = strtotime($udate);
|
|
|
}
|
|
|
$query = [
|
|
|
"bool"=>[
|
|
|
"must"=>[
|
|
|
["term"=>["postid"=>$postid]],
|
|
|
["term"=>["source"=>2]],
|
|
|
["term"=>["folder_as_int"=>1]],
|
|
|
["match_phrase"=>["from.email"=>$email]],
|
|
|
["range"=>["udate"=>['gte'=>$udate]]],
|
|
|
]
|
|
|
]
|
|
|
];
|
|
|
$result = $this->es->search(
|
|
|
['query'=>['constant_score'=>['filter'=>$query]]],
|
|
|
0,10,
|
|
|
['udate'=>"desc"],
|
|
|
50
|
|
|
);
|
|
|
$hits = $result['hits']['hits']??[];
|
|
|
return $hits;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
...
|
...
|
|