yii\elasticsearch\Connection::delete PHP Method

delete() public method

Performs DELETE HTTP request
public delete ( string | array $url, array $options = [], string $body = null, boolean $raw = false ) : mixed
$url string | array URL
$options array URL options
$body string request body
$raw boolean if response body contains JSON and should be decoded
return mixed response
    public function delete($url, $options = [], $body = null, $raw = false)
    {
        $this->open();
        return $this->httpRequest('DELETE', $this->createUrl($url, $options), $body, $raw);
    }

Usage Example

Example #1
0
 /**
  * @param $name
  * @return mixed
  * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html
  */
 public function deleteTemplate($name)
 {
     return $this->db->delete(['_template', $name]);
 }