Property | Type | Description | |
---|---|---|---|
$_callback | callback | ||
$_config | array | log: Set to true, to enable logging, set a string to log to a specific file retryOnConflict: Use in \Elastica\Client::updateDocument bigintConversion: Set to true to enable the JSON bigint to string conversion option (see issue #717) | |
$_connectionPool | Elastica\Connection\ConnectionPool | ||
$_lastRequest | |||
$_lastResponse | |||
$_logger | Psr\Log\LoggerInterface | ||
$_version | string |
Method | Description | |
---|---|---|
__construct ( array $config = [], callback $callback = null, Psr\Log\LoggerInterface $logger = null ) | Creates a new Elastica client. | |
addConnection ( |
||
addDocuments ( array $docs ) : |
Uses _bulk to send documents to the server. | |
addHeader ( string $header, string $headerValue ) | Adds a HTTP Header. | |
bulk ( array $params ) : |
Bulk operation. | |
connect ( ) | Establishes the client connections. | |
deleteDocuments ( array $docs ) : |
Bulk deletes documents. | |
deleteIds ( array $ids, string | |
Deletes documents with the given ids, index, type from the index. | |
getCluster ( ) : |
Returns the current cluster. | |
getConfig ( string $key = '' ) : array | string | Returns a specific config key or the whole config array if not set. | |
getConfigValue ( array | string $keys, mixed $default = null ) : mixed | ||
getConnection ( ) : |
||
getConnectionStrategy ( ) : Elastica\Connection\Strategy\StrategyInterface | ||
getConnections ( ) : |
||
getIndex ( string $name ) : |
Returns the index for the given connection. | |
getLastRequest ( ) : |
||
getLastResponse ( ) : |
||
getStatus ( ) : |
Returns the status object for all indices. | |
getVersion ( ) : string | Get current version. | |
hasConnection ( ) : boolean | Determines whether a valid connection is available for use. | |
optimizeAll ( array $args = [] ) : |
Optimizes all search indices. | |
refreshAll ( ) : |
Refreshes all search indices. | |
removeHeader ( string $header ) | Remove a HTTP Header. | |
request ( string $path, string $method = Request::GET, array | string $data = [], array $query = [] ) : |
Makes calls to the elasticsearch server based on this index. | |
setConfig ( array $config ) | Sets specific config values (updates and keeps default values). | |
setConfigValue ( string $key, mixed $value ) | Sets / overwrites a specific config value. | |
setConnections ( array $connections ) | ||
setLogger ( Psr\Log\LoggerInterface $logger ) | Replace the existing logger. | |
updateDocument ( integer | string $id, array | Elastica\Script\AbstractScript | |
Update document, using update script. Requires elasticsearch >= 0.19.0. | |
updateDocuments ( array $docs ) : |
Uses _bulk to send documents to the server. |
Method | Description | |
---|---|---|
_initConnections ( ) | Inits the client connections. | |
_log ( mixed $context ) | logging. | |
_populateDocumentFieldsFromResponse ( |
||
_prepareConnectionParams ( array $config ) : array | Creates a Connection params array from a Client or server config array. |
public __construct ( array $config = [], callback $callback = null, Psr\Log\LoggerInterface $logger = null ) | ||
$config | array | OPTIONAL Additional config options |
$callback | callback | OPTIONAL Callback function which can be used to be notified about errors (for example connection down) |
$logger | Psr\Log\LoggerInterface |
protected _populateDocumentFieldsFromResponse ( |
||
$response | ||
$document | ||
$fields | string | Array of field names to be populated or '_source' if whole document data should be updated |
protected _prepareConnectionParams ( array $config ) : array | ||
$config | array | |
return | array |
public addConnection ( |
||
$connection |
public addDocuments ( array $docs ) : |
||
$docs | array | Array of Elastica\Document |
return | Response object |
public deleteDocuments ( array $docs ) : |
||
$docs | array | |
return |
public deleteIds ( array $ids, string | |
||
$ids | array | Document ids |
$index | string | |
Index name |
$type | string | |
Type of documents |
$routing | string | boolean | Optional routing key for all ids |
return | Response object |
public getCluster ( ) : |
||
return | Cluster object |
public getConnectionStrategy ( ) : Elastica\Connection\Strategy\StrategyInterface | ||
return | Elastica\Connection\Strategy\StrategyInterface |
public getStatus ( ) : |
||
return | Status object |
public hasConnection ( ) : boolean | ||
return | boolean |
public optimizeAll ( array $args = [] ) : |
||
$args | array | OPTIONAL Optional arguments |
return | Response object |
public refreshAll ( ) : |
||
return | Response object |
public removeHeader ( string $header ) | ||
$header | string | The HTTP Header to remove |
public request ( string $path, string $method = Request::GET, array | string $data = [], array $query = [] ) : |
||
$path | string | Path to call |
$method | string | Rest method to use (GET, POST, DELETE, PUT) |
$data | array | string | OPTIONAL Arguments as array or pre-encoded string |
$query | array | OPTIONAL Query params |
return | Response object |
public setConfigValue ( string $key, mixed $value ) | ||
$key | string | Key to set |
$value | mixed | Value |
public setLogger ( Psr\Log\LoggerInterface $logger ) | ||
$logger | Psr\Log\LoggerInterface |
public updateDocument ( integer | string $id, array | Elastica\Script\AbstractScript | |
||
$id | integer | string | document id |
$data | array | Elastica\Script\AbstractScript | |
raw data for request body |
$index | string | index to update |
$type | string | type of index to update |
$options | array | array of query params to use for query. For possible options check es api |
return |
public updateDocuments ( array $docs ) : |
||
$docs | array | Array of Elastica\Document |
return | Response object |
protected array $_config | ||
return | array |
protected ConnectionPool,Elastica\Connection $_connectionPool | ||
return | Elastica\Connection\ConnectionPool |
protected Request,Elastica|null $_lastRequest | ||
return |
protected Response,Elastica|null $_lastResponse | ||
return |
protected LoggerInterface,Psr\Log $_logger | ||
return | Psr\Log\LoggerInterface |