Skip to content

Commit

Permalink
Cluster/State accepts index parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
polyfractal committed Feb 11, 2014
1 parent 90158a8 commit c5f30c8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Elasticsearch/Namespaces/ClusterNamespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,17 @@ public function reroute($params = array())
*/
public function state($params = array())
{
$index = $this->extractArgument($params, 'index');
$metric = $this->extractArgument($params, 'metric');

/** @var callback $endpointBuilder */
$endpointBuilder = $this->dicEndpoints;

/** @var \Elasticsearch\Endpoints\Cluster\State $endpoint */
$endpoint = $endpointBuilder('Cluster\State');
$endpoint->setParams($params)->setMetric($metric);
$endpoint->setParams($params)
->setIndex($index)
->setMetric($metric);
$response = $endpoint->performRequest();
return $response['data'];
}
Expand Down

0 comments on commit c5f30c8

Please sign in to comment.