staticpublicfunctioninitSearchClient(){if(null==BaseFrontController::$client){$hosts['hosts']=array("host"=>'127.0.0.1',"port"=>'9200','scheme'=>'http');BaseFrontController::$client=\Elasticsearch\ClientBuilder::create()->setSSLVerification(false)->setHosts($hosts)->build();}}// Elastic search
staticpublicfunctionactionSearch($area,$keyword,$start,$end,$size=100,$agg=null){BaseFrontController::initSearchClient();$params['index']=BaseFrontController::getSearchIndex();$params['type']='raw';$params['body']["size"]=$size;// your aggs
if(null!=$agg){$params['body']["aggs"]=$agg;}$params['body']["query"]["filtered"]['filter']["and"]=[["term"=>['Your area'=>$area]],// your area
["range"=>["Your time"=>array("gte"=>$start,"lte"=>$end)]]// your time
];if($keyword!=''){$params['body']["query"]["filtered"]['query']['bool']['should']['match_phrase']=array();// your query word
}$response=BaseFrontController::$client->search($params);return$response;}