class Client in Search API Elasticsearch 8
Class Client @package Drupal\search_api_elasticsearch\Elastica
Hierarchy
- class \Drupal\search_api_elasticsearch\Elastica\Client extends \Elastica\Client
Expanded class hierarchy of Client
File
- src/
Elastica/ Client.php, line 13
Namespace
Drupal\search_api_elasticsearch\ElasticaView source
class Client extends ElasticaClient {
/**
* @param string $path
* @param string $method
* @param array $data
* @param array $query
* @return \Elastica\Response
*/
public function request($path, $method = Request::GET, $data = array(), array $query = array()) {
$response = parent::request($path, $method, $data, $query);
$this
->logQuery($path, $method, $data, $query);
return $response;
}
/**
* @param $path
* @param $method
* @param $data
* @param array $query
*/
private function logQuery($path, $method, $data, array $query) {
if (!$this->_logger || !$this->_logger instanceof RequestLogger) {
return;
}
$connection = $this
->getLastRequest()
->getConnection();
$connection_info = array(
'host' => $connection
->getHost(),
'port' => $connection
->getPort(),
'transport' => $connection
->getTransport(),
'headers' => $connection
->hasConfig('headers') ? $connection
->getConfig('headers') : array(),
);
$this->_logger
->logQuery($path, $method, $data, $connection_info, $query);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Client:: |
private | function | ||
Client:: |
public | function |