easy-swoole / elasticsearch

Elasticsearch client
Apache License 2.0
14 stars 8 forks source link

创建文档时候抛出错误 #7

Open 729343861 opened 4 years ago

729343861 commented 4 years ago

vendor\easyswoole\elasticsearch\src\Endpoints\Create.php

代码段 public function getURI(): string { if (isset($this->id) !== true) { throw new RuntimeException( 'id is required for create' ); } $id = $this->id; if (isset($this->index) !== true) { throw new RuntimeException( 'index is required for create' ); } $index = $this->index; var_dump($this->type); $type = $this->type ?? null; if (isset($type)) { //这里的判断是不是有问题?不建议url传送类型,那么这个扩展包还有其他的方法吗? @trigger_error('Specifying types in urls has been deprecated', E_USER_DEPRECATED); }

    if (isset($type)) {  
        return "/$index/$type/$id/_create";
    }
    return "/$index/_create/$id";
}