|
@@ -486,6 +486,42 @@ class MailListV2Es2 extends Base { |
|
@@ -486,6 +486,42 @@ class MailListV2Es2 extends Base { |
486
|
return $this->es->count($body);
|
486
|
return $this->es->count($body);
|
487
|
}
|
487
|
}
|
488
|
|
488
|
|
|
|
489
|
+
|
|
|
490
|
+
|
|
|
491
|
+
|
|
|
492
|
+ /**
|
|
|
493
|
+ *
|
|
|
494
|
+ */
|
|
|
495
|
+ public function search(){
|
|
|
496
|
+ $postid = app()->request('postid',0);
|
|
|
497
|
+ $email = app()->request('email');
|
|
|
498
|
+ $udate = app()->request('udate');
|
|
|
499
|
+ if(!is_numeric($udate)){
|
|
|
500
|
+ $udate = strtotime($udate);
|
|
|
501
|
+ }
|
|
|
502
|
+ $query = [
|
|
|
503
|
+ "bool"=>[
|
|
|
504
|
+ "must"=>[
|
|
|
505
|
+ ["term"=>["postid"=>$postid]],
|
|
|
506
|
+ ["term"=>["source"=>2]],
|
|
|
507
|
+ ["term"=>["folder_as_int"=>1]],
|
|
|
508
|
+ ["match_phrase"=>["from.email"=>$email]],
|
|
|
509
|
+ ["range"=>["udate"=>['gte'=>$udate]]],
|
|
|
510
|
+ ]
|
|
|
511
|
+ ]
|
|
|
512
|
+ ];
|
|
|
513
|
+ $result = $this->es->search(
|
|
|
514
|
+ ['query'=>['constant_score'=>['filter'=>$query]]],
|
|
|
515
|
+ 0,10,
|
|
|
516
|
+ ['udate'=>"desc"],
|
|
|
517
|
+ 50
|
|
|
518
|
+ );
|
|
|
519
|
+ $hits = $result['hits']['hits']??[];
|
|
|
520
|
+ return $hits;
|
|
|
521
|
+ }
|
|
|
522
|
+
|
|
|
523
|
+
|
|
|
524
|
+
|
489
|
}
|
525
|
}
|
490
|
|
526
|
|
491
|
|
527
|
|