作者 邓超

调优

... ... @@ -41,30 +41,13 @@ class AutoMail {
$not_must[] = ["match_phrase"=>["from.email"=>$str]];
}
}
echo json_encode([
"_source" => ["uuid"],
"query"=>[
"bool"=>[
"must"=>[
["term"=>["folder_as_int" => 1]], // 收件箱
["term"=>["is_auto" => 0]], // 非auto
["term"=>["is_hots" => 0]], // 非预热
["term"=>["deleted" => 0]], // 非删除
// 自动关键字
[
"bool" => [
"should"=> $not_must,
"minimum_should_match" => 1
]
]
]
]
]
]);exit;
// 查询自动回的邮件
$lists = $es->search([
"_source" => ["uuid"],
"query"=>[
"constant_score"=>[
"filter"=>[
"bool"=>[
"must"=>[
["term"=>["folder_as_int" => 1]], // 收件箱
... ... @@ -81,6 +64,8 @@ echo json_encode([
]
]
]
]
]
],0,1000,[],1000);
foreach ($lists['hits']['hits']??[] as $list){
... ...
... ... @@ -71,7 +71,7 @@ class SyncToEsCmd {
break;
}
$id = redis()->lPop('sync_to_es'.S_V2);
$id = redis()->rPop('sync_to_es'.S_V2);
$code = 500;
if($id){
$doc_id = '';
... ... @@ -81,7 +81,7 @@ class SyncToEsCmd {
$data = $db->throw()->first('select * from `lists` where `id` = '.$id);
}
}catch (Throwable $e){
redis()->rPush('sync_to_es'.S_V2,$id);
redis()->lPush('sync_to_es'.S_V2,$id);
_echo('sync to es '.$e->getMessage());
break;
}
... ... @@ -125,7 +125,7 @@ class SyncToEsCmd {
// postid ai邮箱要用 这个是查询黑格
list($data['postid'],$data['source']) = $this->getPostid($data['email_id']);
}catch (Throwable $e){
redis()->rPush('sync_to_es'.S_V2,$id);
redis()->lPush('sync_to_es'.S_V2,$id);
_echo('sync to es '.$e->getMessage());
break;
}
... ...