yii\elasticsearch\Connection::head PHP Method

head() public method

Performs HEAD HTTP request
public head ( string | array $url, array $options = [], string $body = null ) : mixed
$url string | array URL
$options array URL options
$body string request body
return mixed response
    public function head($url, $options = [], $body = null)
    {
        $this->open();
        return $this->httpRequest('HEAD', $this->createUrl($url, $options), $body);
    }

Usage Example

Example #1
0
 /**
  * @param $index
  * @param $type
  * @return mixed
  * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-types-exists.html
  */
 public function typeExists($index, $type)
 {
     return $this->db->head([$index, $type]);
 }