作者 邓超

x

... ... @@ -132,7 +132,7 @@ class SyncToEsCmd {
sleep(5);
$this->es = es('email_lists_copy'); // 第二个库 新
$this->es = es('email_lists_all'); // 第二个库 新
$this->bulkData = new \Lib\Es\BulkData();
... ... @@ -183,7 +183,7 @@ class SyncToEsCmd {
// 只有非ai邮箱才进
if($data['source'] != 2){
// 主库
$this->bulkData->add('email_lists_copy',$doc_id,$data);
$this->bulkData->add('email_lists_all',$doc_id,$data);
}
if($data['postid']){
// 分库
... ... @@ -342,9 +342,9 @@ class SyncToEsCmd {
'description' => ['type' => 'keyword'],
'references' => ['type' => 'keyword']
]
],$index == 'email_lists_copy' ? [
'number_of_shards' => 21, // 设置分片数
'number_of_replicas' => 1, // 设置副本数 暂用内存 主片+副片*
],$index == 'email_lists_all' ? [
'number_of_shards' => 3, // 设置分片数
'number_of_replicas' => 0, // 设置副本数 暂用内存 主片+副片*
]:[
'number_of_shards' => 1, // 设置分片数
'number_of_replicas' => 0, // 设置副本数 暂用内存 主片+副片*
... ... @@ -391,7 +391,7 @@ class SyncToEsCmd {
foreach ($this->bulkData->getIndexs() as $index){
$this->es->setIndex($index);
// 检查数据库是否存在
if(empty($this->checkEsIndex[$index]) && $index != 'email_lists_copy'){
if(empty($this->checkEsIndex[$index]) && $index != 'email_lists_all'){
if(!redis()->has('esmapcheck:'.$index)){
$m = $this->setEsMap($index);
if($m !== 9) _echo("{$index} 创建索引 ".$m);
... ...
... ... @@ -23,7 +23,7 @@ class HomeEs extends Base {
public function __construct()
{
$this->es = \es('email_lists_copy');
$this->es = \es('email_lists_all');
$postid = app()->request('postid','','intval');
if($postid) $this->es->setIndex('email_lists_branch_'.$postid);
}
... ...
... ... @@ -28,7 +28,7 @@ class MailListV2Es2 extends Base {
public function __construct()
{
$this->es = \es('email_lists_copy');
$this->es = \es('email_lists_all');
$postid = app()->request('postid','','intval');
$this->es->setIndex('email_lists_branch_'.$postid);
}
... ...
... ... @@ -791,7 +791,7 @@ function minMaxToArray($min, $max,$len=1000) {
* @author:dc
* @time 2025/5/22 9:42
*/
function es(string $index='email_lists_copy'){
function es(string $index='email_lists_all'){
return (new Lib\Es\Es($index,['https://ai-email:3mLbEKwDX9YjUDFm@172.19.0.56:9200']));
}
... ...