IMPORTANT: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
current release documentation.
Providing custom query parameters
editProviding custom query parameters
editSometimes you need to provide custom query params, such as authentication tokens for a third-party plugin or proxy. All query parameters are white-listed in Elasticsearch-php, which is to protect you from specifying a param which is not accepted by Elasticsearch.
If you need custom parameters, you need to bypass this whitelisting mechanism. To do so, add them to the custom
parameter as an array of values:
$getParams = array( 'index' => 'test', 'type' => 'test', 'id' => 1, 'parent' => 'abc', // white-listed 'custom' => array('customToken' => 'abc', 'otherToken' => 123) // user-defined, not white listed, not checked ); $exists = $client->exists($getParams);