Свойство | Type | Description | |
---|---|---|---|
$activeNode | the active node. Key of one of the [[nodes]]. Will be randomly selected on Connection::open. | ||
$auth | Authentication data used to connect to the ElasticSearch node. Array elements: - username: the username for authentication. - password: the password for authentication. Array either MUST contain both username and password on not contain any authentication credentials. | ||
$autodetectCluster | whether to autodetect available cluster nodes on Connection::open | ||
$connectionTimeout | timeout to use for connecting to an elasticsearch node. This value will be used to configure the curl CURLOPT_CONNECTTIMEOUT option. If not set, no explicit timeout will be set for curl. | ||
$dataTimeout | timeout to use when reading the response from an elasticsearch node. This value will be used to configure the curl CURLOPT_TIMEOUT option. If not set, no explicit timeout will be set for curl. | ||
$defaultProtocol | If [[autodetectCluster]] is true, all nodes received from cluster will be set to use the protocol defined by [[defaultProtocol]] | ||
$nodes | The elasticsearch cluster nodes to connect to. This is populated with the result of a cluster nodes request when [[autodetectCluster]] is true. Additional special options: - auth: overrides [[auth]] property. For example: php [ 'http_address' => 'inet[/127.0.0.1:9200]', 'auth' => ['username' => 'yiiuser', 'password' => 'yiipw'], // Overrides the auth property of the class with specific login and password 'auth' => ['username' => 'yiiuser', 'password' => 'yiipw'], // Disabled auth regardless of auth property of the class ] - protocol: explicitly sets the protocol for the current node (useful when manually defining a HTTPS cluster) |
Méthode | Description | |
---|---|---|
__sleep ( ) : array | Closes the connection when this component is being serialized. | |
close ( ) | Closes the currently active DB connection. | |
createBulkCommand ( array $config = [] ) : |
Creates a bulk command for execution. | |
createCommand ( array $config = [] ) : |
Creates a command for execution. | |
delete ( string | array $url, array $options = [], string $body = null, boolean $raw = false ) : mixed | Performs DELETE HTTP request | |
get ( string | array $url, array $options = [], string $body = null, boolean $raw = false ) : mixed | Performs GET HTTP request | |
getClusterState ( ) | ||
getDriverName ( ) : string | Returns the name of the DB driver for the current [[dsn]]. | |
getIsActive ( ) : boolean | Returns a value indicating whether the DB connection is established. | |
getNodeInfo ( ) | ||
getQueryBuilder ( ) : |
Creates new query builder instance | |
head ( string | array $url, array $options = [], string $body = null ) : mixed | Performs HEAD HTTP request | |
init ( ) | ||
open ( ) | Establishes a DB connection. | |
post ( string | array $url, array $options = [], string $body = null, boolean $raw = false ) : mixed | Performs POST HTTP request | |
put ( string | array $url, array $options = [], string $body = null, boolean $raw = false ) : mixed | Performs PUT HTTP request |
Méthode | Description | |
---|---|---|
decodeErrorBody ( $body ) : mixed | Try to decode error information if it is valid json, return it if not. | |
httpRequest ( string $method, string $url, string $requestBody = null, boolean $raw = false ) : mixed | Performs HTTP request | |
initConnection ( ) | Initializes the DB connection. | |
populateNodes ( ) | Populates [[nodes]] with the result of a cluster nodes request. | |
selectActiveNode ( ) | select active node randomly |
Méthode | Description | |
---|---|---|
createUrl ( string | array $path, array $options = [] ) : array | Creates URL | |
resetCurlHandle ( ) |
public createBulkCommand ( array $config = [] ) : |
||
$config | array | the configuration for the [[BulkCommand]] class |
Résultat | the DB command |
public createCommand ( array $config = [] ) : |
||
$config | array | the configuration for the Command class |
Résultat | the DB command |
protected decodeErrorBody ( $body ) : mixed | ||
$body | ||
Résultat | mixed |
public getDriverName ( ) : string | ||
Résultat | string | name of the DB driver |
public getIsActive ( ) : boolean | ||
Résultat | boolean | whether the DB connection is established |
public getQueryBuilder ( ) : |
||
Résultat |
protected initConnection ( ) |
public open ( ) |
protected populateNodes ( ) |
public $activeNode |
public $auth |
public $autodetectCluster |
public $connectionTimeout |
public $dataTimeout |
public $defaultProtocol |
public $nodes |