|
@@ -11,6 +11,8 @@ use app\common\service\Elastic;
|
|
|
class Es extends Base
|
|
|
{
|
|
|
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* @title 验证索引
|
|
|
* @desc
|
|
@@ -25,6 +27,20 @@ class Es extends Base
|
|
|
$this->success('ok',$res);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ public function addTest()
|
|
|
+ {
|
|
|
+ $index = input('index','gaoyixia');
|
|
|
+ $type = input('type','video');
|
|
|
+ $id = input('id');
|
|
|
+ switch($type) {
|
|
|
+ case "video":
|
|
|
+ $res= VideoUrl::esAdd($id,[]);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ $this->success('ok',$res);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* @title 创建索引
|
|
|
* @desc
|
|
@@ -34,7 +50,7 @@ class Es extends Base
|
|
|
*/
|
|
|
public function createIndex()
|
|
|
{
|
|
|
- $index = input('index','gaoyixia');
|
|
|
+ $index = input('index','gaoyixia');
|
|
|
$res = Elastic::createIndex($index);
|
|
|
$this->success('ok',$res);
|
|
|
}
|
|
@@ -49,7 +65,7 @@ class Es extends Base
|
|
|
*/
|
|
|
public function delIndex()
|
|
|
{
|
|
|
- $index = input('index','gaoyixia');
|
|
|
+ $index = input('index','gaoyixia');
|
|
|
$res = Elastic::delIndex($index);
|
|
|
$this->success('ok',$res);
|
|
|
}
|