Open jinrongchen opened 8 years ago
我这边用的环境是rtf的版本,没用其他的专门的插件之类的,语言为PHP 通过PHP的CURL来模拟提交实现的搜索
$ch = curl_init(); curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);//show result on your screen if($post) { if ($isjson) { curl_setopt($ch, CURLOPT_POSTFIELDS, $data); } else { curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data,JSON_UNESCAPED_SLASHES)); } } curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); // if any redirection after upload $data = curl_exec($ch);//run by curl $data = json_decode($data,true); return $data;
传入的filter如下:
$filter = array( "bool"=>array( "must"=>array( array("match"=>array("subject"=>$keyword)), array("range"=>array("displayorder"=>array("gte"=>0))) ), "must_not"=>array(), "should"=>array() ) );
特殊字符别分词,就肯定可以搜索到
我这边用的环境是rtf的版本,没用其他的专门的插件之类的,语言为PHP 通过PHP的CURL来模拟提交实现的搜索
$ch = curl_init(); curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);//show result on your screen if($post) { if ($isjson) { curl_setopt($ch, CURLOPT_POSTFIELDS, $data); } else { curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data,JSON_UNESCAPED_SLASHES)); } } curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); // if any redirection after upload $data = curl_exec($ch);//run by curl $data = json_decode($data,true); return $data;
传入的filter如下:
$filter = array( "bool"=>array( "must"=>array( array("match"=>array("subject"=>$keyword)), array("range"=>array("displayorder"=>array("gte"=>0))) ), "must_not"=>array(), "should"=>array() ) );