Свойство | Тип | Описание | |
---|---|---|---|
$_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 |
Метод | Описание | |
---|---|---|
__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. |
Метод | Описание | |
---|---|---|
_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 | |
Результат | array |
public addConnection ( |
||
$connection |
public addDocuments ( array $docs ) : |
||
$docs | array | Array of Elastica\Document |
Результат | Response object |
public deleteDocuments ( array $docs ) : |
||
$docs | array | |
Результат |
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 |
Результат | Response object |
public getCluster ( ) : |
||
Результат | Cluster object |
public getConnectionStrategy ( ) : Elastica\Connection\Strategy\StrategyInterface | ||
Результат | Elastica\Connection\Strategy\StrategyInterface |
public getLastRequest ( ) : |
||
Результат |
public getLastResponse ( ) : |
||
Результат |
public getStatus ( ) : |
||
Результат | Status object |
public hasConnection ( ) : boolean | ||
Результат | boolean |
public optimizeAll ( array $args = [] ) : |
||
$args | array | OPTIONAL Optional arguments |
Результат | Response object |
public refreshAll ( ) : |
||
Результат | 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 |
Результат | 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 |
Результат |
public updateDocuments ( array $docs ) : |
||
$docs | array | Array of Elastica\Document |
Результат | Response object |
protected array $_config | ||
Результат | array |
protected ConnectionPool,Elastica\Connection $_connectionPool | ||
Результат | Elastica\Connection\ConnectionPool |
protected Request,Elastica|null $_lastRequest | ||
Результат |
protected Response,Elastica|null $_lastResponse | ||
Результат |
protected LoggerInterface,Psr\Log $_logger | ||
Результат | Psr\Log\LoggerInterface |