diff --git a/src/Elasticsearch/Client.php b/src/Elasticsearch/Client.php index 8b4fa7309..7ca5cac59 100644 --- a/src/Elasticsearch/Client.php +++ b/src/Elasticsearch/Client.php @@ -5,6 +5,7 @@ use Elasticsearch\Common\Exceptions\InvalidArgumentException; use Elasticsearch\Common\Exceptions\Missing404Exception; use Elasticsearch\Common\Exceptions\TransportException; +use Elasticsearch\Endpoints\AbstractEndpoint; use Elasticsearch\Namespaces\CatNamespace; use Elasticsearch\Namespaces\ClusterNamespace; use Elasticsearch\Namespaces\IndicesNamespace; @@ -103,7 +104,8 @@ public function info($params = []) /** @var \Elasticsearch\Endpoints\Info $endpoint */ $endpoint = $endpointBuilder('Info'); - $response = $endpoint->setParams($params)->performRequest(); + $endpoint->setParams($params); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -120,9 +122,10 @@ public function ping($params = []) /** @var \Elasticsearch\Endpoints\Ping $endpoint */ $endpoint = $endpointBuilder('Ping'); + $endpoint->setParams($params); try { - $response = $endpoint->setParams($params)->performRequest(); + $response = $this->performRequest($endpoint); $endpoint->resultOrFuture($response); } catch (Missing404Exception $exception) { return false; @@ -155,9 +158,7 @@ public function ping($params = []) public function get($params) { $id = $this->extractArgument($params, 'id'); - $index = $this->extractArgument($params, 'index'); - $type = $this->extractArgument($params, 'type'); /** @var callback $endpointBuilder */ @@ -169,7 +170,7 @@ public function get($params) ->setIndex($index) ->setType($type); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -192,9 +193,7 @@ public function get($params) public function getSource($params) { $id = $this->extractArgument($params, 'id'); - $index = $this->extractArgument($params, 'index'); - $type = $this->extractArgument($params, 'type'); /** @var callback $endpointBuilder */ @@ -207,7 +206,7 @@ public function getSource($params) ->setType($type) ->returnOnlySource(); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -247,7 +246,7 @@ public function delete($params) ->setIndex($index) ->setType($type); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -271,9 +270,7 @@ public function delete($params) public function count($params = array()) { $index = $this->extractArgument($params, 'index'); - $type = $this->extractArgument($params, 'type'); - $body = $this->extractArgument($params, 'body'); /** @var callback $endpointBuilder */ @@ -285,7 +282,7 @@ public function count($params = array()) ->setType($type) ->setBody($body); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -328,7 +325,7 @@ public function countPercolate($params = array()) ->setID($id) ->setBody($body); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -362,7 +359,7 @@ public function percolate($params) ->setID($id) ->setBody($body); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -395,7 +392,7 @@ public function mpercolate($params = array()) ->setType($type) ->setBody($body); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -435,7 +432,7 @@ public function termvectors($params = array()) ->setID($id) ->setBody($body); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -474,7 +471,7 @@ public function mtermvectors($params = array()) ->setType($type) ->setBody($body); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -496,9 +493,7 @@ public function mtermvectors($params = array()) public function exists($params) { $id = $this->extractArgument($params, 'id'); - $index = $this->extractArgument($params, 'index'); - $type = $this->extractArgument($params, 'type'); //manually make this verbose so we can check status code @@ -514,7 +509,7 @@ public function exists($params) ->setType($type); $endpoint->setParams($params); - return BooleanRequestWrapper::performRequest($endpoint); + return BooleanRequestWrapper::performRequest($endpoint, $this->transport); } /** @@ -538,9 +533,7 @@ public function exists($params) public function mget($params = array()) { $index = $this->extractArgument($params, 'index'); - $type = $this->extractArgument($params, 'type'); - $body = $this->extractArgument($params, 'body'); /** @var callback $endpointBuilder */ @@ -552,7 +545,7 @@ public function mget($params = array()) ->setType($type) ->setBody($body); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -570,9 +563,7 @@ public function mget($params = array()) public function msearch($params = array()) { $index = $this->extractArgument($params, 'index'); - $type = $this->extractArgument($params, 'type'); - $body = $this->extractArgument($params, 'body'); /** @var callback $endpointBuilder */ @@ -584,7 +575,7 @@ public function msearch($params = array()) ->setType($type) ->setBody($body); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -612,11 +603,8 @@ public function msearch($params = array()) public function create($params) { $id = $this->extractArgument($params, 'id'); - $index = $this->extractArgument($params, 'index'); - $type = $this->extractArgument($params, 'type'); - $body = $this->extractArgument($params, 'body'); /** @var callback $endpointBuilder */ @@ -630,7 +618,7 @@ public function create($params) ->setBody($body) ->createIfAbsent(); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -651,9 +639,7 @@ public function create($params) public function bulk($params = array()) { $index = $this->extractArgument($params, 'index'); - $type = $this->extractArgument($params, 'type'); - $body = $this->extractArgument($params, 'body'); /** @var callback $endpointBuilder */ @@ -665,7 +651,7 @@ public function bulk($params = array()) ->setType($type) ->setBody($body); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -694,11 +680,8 @@ public function bulk($params = array()) public function index($params) { $id = $this->extractArgument($params, 'id'); - $index = $this->extractArgument($params, 'index'); - $type = $this->extractArgument($params, 'type'); - $body = $this->extractArgument($params, 'body'); /** @var callback $endpointBuilder */ @@ -711,7 +694,7 @@ public function index($params) ->setType($type) ->setBody($body); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -738,7 +721,7 @@ public function reindex($params) $endpoint = $endpointBuilder('Reindex'); $endpoint->setBody($body); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -758,7 +741,6 @@ public function reindex($params) public function suggest($params = array()) { $index = $this->extractArgument($params, 'index'); - $body = $this->extractArgument($params, 'body'); /** @var callback $endpointBuilder */ @@ -769,7 +751,7 @@ public function suggest($params = array()) $endpoint->setIndex($index) ->setBody($body); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -802,11 +784,8 @@ public function suggest($params = array()) public function explain($params) { $id = $this->extractArgument($params, 'id'); - $index = $this->extractArgument($params, 'index'); - $type = $this->extractArgument($params, 'type'); - $body = $this->extractArgument($params, 'body'); /** @var callback $endpointBuilder */ @@ -819,7 +798,7 @@ public function explain($params) ->setType($type) ->setBody($body); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -879,7 +858,7 @@ public function search($params = array()) ->setType($type) ->setBody($body); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -911,7 +890,7 @@ public function searchShards($params = array()) $endpoint->setIndex($index) ->setType($type); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -939,7 +918,7 @@ public function searchTemplate($params = array()) ->setType($type) ->setBody($body); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -956,7 +935,6 @@ public function searchTemplate($params = array()) public function scroll($params = array()) { $scrollID = $this->extractArgument($params, 'scroll_id'); - $body = $this->extractArgument($params, 'body'); /** @var callback $endpointBuilder */ @@ -967,7 +945,7 @@ public function scroll($params = array()) $endpoint->setScrollID($scrollID) ->setBody($body); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -984,7 +962,6 @@ public function scroll($params = array()) public function clearScroll($params = array()) { $scrollID = $this->extractArgument($params, 'scroll_id'); - $body = $this->extractArgument($params, 'body'); /** @var callback $endpointBuilder */ @@ -996,7 +973,7 @@ public function clearScroll($params = array()) ->setBody($body) ->setClearScroll(true); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -1027,11 +1004,8 @@ public function clearScroll($params = array()) public function update($params) { $id = $this->extractArgument($params, 'id'); - $index = $this->extractArgument($params, 'index'); - $type = $this->extractArgument($params, 'type'); - $body = $this->extractArgument($params, 'body'); /** @var callback $endpointBuilder */ @@ -1044,7 +1018,7 @@ public function update($params) ->setType($type) ->setBody($body); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -1070,7 +1044,7 @@ public function getScript($params) $endpoint->setID($id) ->setLang($lang); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -1096,7 +1070,7 @@ public function deleteScript($params) $endpoint->setID($id) ->setLang($lang); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -1124,7 +1098,7 @@ public function putScript($params) ->setLang($lang) ->setBody($body); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -1147,7 +1121,7 @@ public function getTemplate($params) $endpoint = $endpointBuilder('Template\Get'); $endpoint->setID($id); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -1170,7 +1144,7 @@ public function deleteTemplate($params) $endpoint = $endpointBuilder('Template\Delete'); $endpoint->setID($id); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -1193,9 +1167,9 @@ public function putTemplate($params) /** @var \Elasticsearch\Endpoints\Template\Put $endpoint */ $endpoint = $endpointBuilder('Template\Put'); $endpoint->setID($id) - ->setBody($body); - $endpoint->setParams($params); - $response = $endpoint->performRequest(); + ->setBody($body) + ->setParams($params); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -1223,9 +1197,9 @@ public function fieldStats($params = array()) /** @var \Elasticsearch\Endpoints\FieldStats $endpoint */ $endpoint = $endpointBuilder('FieldStats'); $endpoint->setIndex($index) - ->setBody($body); - $endpoint->setParams($params); - $response = $endpoint->performRequest(); + ->setBody($body) + ->setParams($params); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -1250,7 +1224,7 @@ public function renderSearchTemplate($params = array()) $endpoint->setBody($body) ->setID($id); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -1364,4 +1338,23 @@ private function verifyNotNullOrEmpty($name, $var) } } } + + /** + * @param $endpoint AbstractEndpoint + * + * @throws \Exception + * @return array + */ + private function performRequest(AbstractEndpoint $endpoint) + { + $promise = $this->transport->performRequest( + $endpoint->getMethod(), + $endpoint->getURI(), + $endpoint->getParams(), + $endpoint->getBody(), + $endpoint->getOptions() + ); + + return $promise; + } } diff --git a/src/Elasticsearch/ClientBuilder.php b/src/Elasticsearch/ClientBuilder.php index 0814edb81..3d8557a8e 100644 --- a/src/Elasticsearch/ClientBuilder.php +++ b/src/Elasticsearch/ClientBuilder.php @@ -430,12 +430,12 @@ public function build() $transport = $this->transport; $serializer = $this->serializer; - $this->endpoint = function ($class) use ($transport, $serializer) { + $this->endpoint = function ($class) use ($serializer) { $fullPath = '\\Elasticsearch\\Endpoints\\' . $class; if ($class === 'Bulk' || $class === 'Msearch' || $class === 'MPercolate') { - return new $fullPath($transport, $serializer); + return new $fullPath($serializer); } else { - return new $fullPath($transport); + return new $fullPath(); } }; } diff --git a/src/Elasticsearch/Endpoints/AbstractEndpoint.php b/src/Elasticsearch/Endpoints/AbstractEndpoint.php index 7cc902650..e764db69f 100644 --- a/src/Elasticsearch/Endpoints/AbstractEndpoint.php +++ b/src/Elasticsearch/Endpoints/AbstractEndpoint.php @@ -3,6 +3,7 @@ namespace Elasticsearch\Endpoints; use Elasticsearch\Common\Exceptions\UnexpectedValueException; +use Elasticsearch\Serializers\SerializerInterface; use Elasticsearch\Transport; use Exception; use GuzzleHttp\Ring\Future\FutureArrayInterface; @@ -36,51 +37,27 @@ abstract class AbstractEndpoint /** @var array */ protected $body = null; - /** @var \Elasticsearch\Transport */ - private $transport = null; - /** @var array */ private $options = []; + /** @var SerializerInterface */ + protected $serializer; + /** * @return string[] */ - abstract protected function getParamWhitelist(); + abstract public function getParamWhitelist(); /** * @return string */ - abstract protected function getURI(); + abstract public function getURI(); /** * @return string */ - abstract protected function getMethod(); - - /** - * @param Transport $transport - */ - public function __construct($transport) - { - $this->transport = $transport; - } + abstract public function getMethod(); - /** - * @throws \Exception - * @return array - */ - public function performRequest() - { - $promise = $this->transport->performRequest( - $this->getMethod(), - $this->getURI(), - $this->params, - $this->getBody(), - $this->options - ); - - return $promise; - } /** * Set the parameters for this endpoint @@ -102,6 +79,22 @@ public function setParams($params) return $this; } + /** + * @return array + */ + public function getParams() + { + return $this->params; + } + + /** + * @return array + */ + public function getOptions() + { + return $this->options; + } + /** * @param string $index * @@ -182,7 +175,7 @@ public function resultOrFuture($result) /** * @return array */ - protected function getBody() + public function getBody() { return $this->body; } diff --git a/src/Elasticsearch/Endpoints/Bulk.php b/src/Elasticsearch/Endpoints/Bulk.php index 95963471f..3071876a1 100644 --- a/src/Elasticsearch/Endpoints/Bulk.php +++ b/src/Elasticsearch/Endpoints/Bulk.php @@ -17,13 +17,11 @@ class Bulk extends AbstractEndpoint implements BulkEndpointInterface { /** - * @param Transport $transport * @param SerializerInterface $serializer */ - public function __construct(Transport $transport, SerializerInterface $serializer) + public function __construct(SerializerInterface $serializer) { $this->serializer = $serializer; - parent::__construct($transport); } /** @@ -51,7 +49,7 @@ public function setBody($body) /** * @return string */ - protected function getURI() + public function getURI() { return $this->getOptionalURI('_bulk'); } @@ -59,7 +57,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'consistency', @@ -74,7 +72,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'POST'; } diff --git a/src/Elasticsearch/Endpoints/BulkEndpointInterface.php b/src/Elasticsearch/Endpoints/BulkEndpointInterface.php index 72fd3e88e..c7da25451 100644 --- a/src/Elasticsearch/Endpoints/BulkEndpointInterface.php +++ b/src/Elasticsearch/Endpoints/BulkEndpointInterface.php @@ -19,8 +19,7 @@ interface BulkEndpointInterface /** * Constructor * - * @param Transport $transport Transport instance * @param SerializerInterface $serializer A serializer */ - public function __construct(Transport $transport, SerializerInterface $serializer); + public function __construct(SerializerInterface $serializer); } diff --git a/src/Elasticsearch/Endpoints/Cat/Aliases.php b/src/Elasticsearch/Endpoints/Cat/Aliases.php index 7ed256caf..377b7088d 100644 --- a/src/Elasticsearch/Endpoints/Cat/Aliases.php +++ b/src/Elasticsearch/Endpoints/Cat/Aliases.php @@ -37,7 +37,7 @@ public function setName($name) /** * @return string */ - protected function getURI() + public function getURI() { $name = $this->name; $uri = "/_cat/aliases"; @@ -52,7 +52,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'local', @@ -67,7 +67,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Cat/Allocation.php b/src/Elasticsearch/Endpoints/Cat/Allocation.php index eb3f38ab4..c1d39fae1 100644 --- a/src/Elasticsearch/Endpoints/Cat/Allocation.php +++ b/src/Elasticsearch/Endpoints/Cat/Allocation.php @@ -37,7 +37,7 @@ public function setNodeId($node_id) /** * @return string */ - protected function getURI() + public function getURI() { $node_id = $this->node_id; $uri = "/_cat/allocation"; @@ -52,7 +52,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'bytes', @@ -67,7 +67,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Cat/Count.php b/src/Elasticsearch/Endpoints/Cat/Count.php index 93d6a7582..242161b96 100644 --- a/src/Elasticsearch/Endpoints/Cat/Count.php +++ b/src/Elasticsearch/Endpoints/Cat/Count.php @@ -18,7 +18,7 @@ class Count extends AbstractEndpoint /** * @return string */ - protected function getURI() + public function getURI() { $index = $this->index; $uri = "/_cat/count"; @@ -33,7 +33,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'local', @@ -47,7 +47,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Cat/Fielddata.php b/src/Elasticsearch/Endpoints/Cat/Fielddata.php index 81b57a245..8da689e09 100644 --- a/src/Elasticsearch/Endpoints/Cat/Fielddata.php +++ b/src/Elasticsearch/Endpoints/Cat/Fielddata.php @@ -36,7 +36,7 @@ public function setFields($fields) /** * @return string */ - protected function getURI() + public function getURI() { $fields = $this->fields; $uri = "/_cat/fielddata"; @@ -51,7 +51,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'local', @@ -65,7 +65,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Cat/Health.php b/src/Elasticsearch/Endpoints/Cat/Health.php index 7eaf8ebfc..f662ded64 100644 --- a/src/Elasticsearch/Endpoints/Cat/Health.php +++ b/src/Elasticsearch/Endpoints/Cat/Health.php @@ -18,7 +18,7 @@ class Health extends AbstractEndpoint /** * @return string */ - protected function getURI() + public function getURI() { $uri = "/_cat/health"; @@ -28,7 +28,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'local', @@ -43,7 +43,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Cat/Help.php b/src/Elasticsearch/Endpoints/Cat/Help.php index 56cf26d35..2216a3c9e 100644 --- a/src/Elasticsearch/Endpoints/Cat/Help.php +++ b/src/Elasticsearch/Endpoints/Cat/Help.php @@ -18,7 +18,7 @@ class Help extends AbstractEndpoint /** * @return string */ - protected function getURI() + public function getURI() { $uri = "/_cat"; @@ -28,7 +28,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'help', @@ -38,7 +38,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Cat/Indices.php b/src/Elasticsearch/Endpoints/Cat/Indices.php index ac88d1e97..8a164e672 100644 --- a/src/Elasticsearch/Endpoints/Cat/Indices.php +++ b/src/Elasticsearch/Endpoints/Cat/Indices.php @@ -19,7 +19,7 @@ class Indices extends AbstractEndpoint /** * @return string */ - protected function getURI() + public function getURI() { $index = $this->index; $uri = "/_cat/indices"; @@ -34,7 +34,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'bytes', @@ -50,7 +50,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Cat/Master.php b/src/Elasticsearch/Endpoints/Cat/Master.php index ff9cb4d25..a17bab4b6 100644 --- a/src/Elasticsearch/Endpoints/Cat/Master.php +++ b/src/Elasticsearch/Endpoints/Cat/Master.php @@ -18,7 +18,7 @@ class Master extends AbstractEndpoint /** * @return string */ - protected function getURI() + public function getURI() { $uri = "/_cat/master"; @@ -28,7 +28,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'local', @@ -42,7 +42,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Cat/NodeAttrs.php b/src/Elasticsearch/Endpoints/Cat/NodeAttrs.php index 72151b411..45e01ae21 100644 --- a/src/Elasticsearch/Endpoints/Cat/NodeAttrs.php +++ b/src/Elasticsearch/Endpoints/Cat/NodeAttrs.php @@ -18,7 +18,7 @@ class NodeAttrs extends AbstractEndpoint /** * @return string */ - protected function getURI() + public function getURI() { $uri = "/_cat/nodeattrs"; @@ -28,7 +28,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'local', @@ -42,7 +42,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Cat/Nodes.php b/src/Elasticsearch/Endpoints/Cat/Nodes.php index 8ba7b5fa8..92a97f503 100644 --- a/src/Elasticsearch/Endpoints/Cat/Nodes.php +++ b/src/Elasticsearch/Endpoints/Cat/Nodes.php @@ -18,7 +18,7 @@ class Nodes extends AbstractEndpoint /** * @return string */ - protected function getURI() + public function getURI() { $uri = "/_cat/nodes"; @@ -28,7 +28,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'local', @@ -42,7 +42,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Cat/PendingTasks.php b/src/Elasticsearch/Endpoints/Cat/PendingTasks.php index 11550bf74..9fec9e06d 100644 --- a/src/Elasticsearch/Endpoints/Cat/PendingTasks.php +++ b/src/Elasticsearch/Endpoints/Cat/PendingTasks.php @@ -18,7 +18,7 @@ class PendingTasks extends AbstractEndpoint /** * @return string */ - protected function getURI() + public function getURI() { $uri = "/_cat/pending_tasks"; @@ -28,7 +28,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'local', @@ -42,7 +42,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Cat/Plugins.php b/src/Elasticsearch/Endpoints/Cat/Plugins.php index f7ac27958..beb51ea12 100644 --- a/src/Elasticsearch/Endpoints/Cat/Plugins.php +++ b/src/Elasticsearch/Endpoints/Cat/Plugins.php @@ -18,7 +18,7 @@ class Plugins extends AbstractEndpoint /** * @return string */ - protected function getURI() + public function getURI() { $uri = "/_cat/plugins"; @@ -28,7 +28,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'local', @@ -42,7 +42,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Cat/Recovery.php b/src/Elasticsearch/Endpoints/Cat/Recovery.php index 8c2faf40f..3ab4413f4 100644 --- a/src/Elasticsearch/Endpoints/Cat/Recovery.php +++ b/src/Elasticsearch/Endpoints/Cat/Recovery.php @@ -18,7 +18,7 @@ class Recovery extends AbstractEndpoint /** * @return string */ - protected function getURI() + public function getURI() { $index = $this->index; $uri = "/_cat/recovery"; @@ -33,7 +33,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'bytes', @@ -48,7 +48,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Cat/Repositories.php b/src/Elasticsearch/Endpoints/Cat/Repositories.php index 484b29b86..94984cddd 100644 --- a/src/Elasticsearch/Endpoints/Cat/Repositories.php +++ b/src/Elasticsearch/Endpoints/Cat/Repositories.php @@ -18,7 +18,7 @@ class Repositories extends AbstractEndpoint /** * @return string */ - protected function getURI() + public function getURI() { $uri = "/_cat/repositories"; @@ -28,7 +28,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'local', @@ -42,7 +42,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Cat/Segments.php b/src/Elasticsearch/Endpoints/Cat/Segments.php index 519d3c6ff..b3d231e58 100644 --- a/src/Elasticsearch/Endpoints/Cat/Segments.php +++ b/src/Elasticsearch/Endpoints/Cat/Segments.php @@ -25,7 +25,7 @@ class Segments extends AbstractEndpoint /** * @return string */ - protected function getURI() + public function getURI() { $index = $this->index; $uri = "/_cat/segments"; @@ -41,7 +41,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'h', @@ -54,7 +54,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Cat/Shards.php b/src/Elasticsearch/Endpoints/Cat/Shards.php index 94a10296e..586d0afcf 100644 --- a/src/Elasticsearch/Endpoints/Cat/Shards.php +++ b/src/Elasticsearch/Endpoints/Cat/Shards.php @@ -18,7 +18,7 @@ class Shards extends AbstractEndpoint /** * @return string */ - protected function getURI() + public function getURI() { $index = $this->index; $uri = "/_cat/shards"; @@ -33,7 +33,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'bytes', @@ -48,7 +48,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Cat/Snapshots.php b/src/Elasticsearch/Endpoints/Cat/Snapshots.php index 8a6127eb2..bb5d1e4a2 100644 --- a/src/Elasticsearch/Endpoints/Cat/Snapshots.php +++ b/src/Elasticsearch/Endpoints/Cat/Snapshots.php @@ -36,7 +36,7 @@ public function setRepository($repository) /** * @return string */ - protected function getURI() + public function getURI() { if (isset($this->repository) !== true) { throw new Exceptions\RuntimeException( @@ -51,7 +51,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'local', @@ -65,7 +65,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Cat/Tasks.php b/src/Elasticsearch/Endpoints/Cat/Tasks.php index 785334e07..57ed09321 100644 --- a/src/Elasticsearch/Endpoints/Cat/Tasks.php +++ b/src/Elasticsearch/Endpoints/Cat/Tasks.php @@ -18,7 +18,7 @@ class Tasks extends AbstractEndpoint /** * @return string */ - protected function getURI() + public function getURI() { return "/_cat/tasks"; } @@ -26,7 +26,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'format', @@ -44,7 +44,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Cat/ThreadPool.php b/src/Elasticsearch/Endpoints/Cat/ThreadPool.php index 0507960d2..a67678a51 100644 --- a/src/Elasticsearch/Endpoints/Cat/ThreadPool.php +++ b/src/Elasticsearch/Endpoints/Cat/ThreadPool.php @@ -19,7 +19,7 @@ class ThreadPool extends AbstractEndpoint /** * @return string */ - protected function getURI() + public function getURI() { $uri = "/_cat/thread_pool"; @@ -29,7 +29,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'local', @@ -45,7 +45,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/ClearScroll.php b/src/Elasticsearch/Endpoints/ClearScroll.php index 38256d3cf..e9600171d 100644 --- a/src/Elasticsearch/Endpoints/ClearScroll.php +++ b/src/Elasticsearch/Endpoints/ClearScroll.php @@ -38,7 +38,7 @@ public function setScroll_Id($scroll_id) * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->scroll_id) !== true) { throw new Exceptions\RuntimeException( @@ -58,7 +58,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( ); @@ -67,7 +67,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'DELETE'; } diff --git a/src/Elasticsearch/Endpoints/Cluster/AllocationExplain.php b/src/Elasticsearch/Endpoints/Cluster/AllocationExplain.php index de25780e7..0fcb5478d 100644 --- a/src/Elasticsearch/Endpoints/Cluster/AllocationExplain.php +++ b/src/Elasticsearch/Endpoints/Cluster/AllocationExplain.php @@ -36,7 +36,7 @@ public function setBody($body) /** * @return string */ - protected function getURI() + public function getURI() { return "/_cluster/allocation/explain"; } @@ -44,7 +44,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'include_yes_decisions' @@ -54,7 +54,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Cluster/Health.php b/src/Elasticsearch/Endpoints/Cluster/Health.php index 7f4cc7589..66907d920 100644 --- a/src/Elasticsearch/Endpoints/Cluster/Health.php +++ b/src/Elasticsearch/Endpoints/Cluster/Health.php @@ -18,7 +18,7 @@ class Health extends AbstractEndpoint /** * @return string */ - protected function getURI() + public function getURI() { $index = $this->index; $uri = "/_cluster/health"; @@ -33,7 +33,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'level', @@ -50,7 +50,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Cluster/Nodes/HotThreads.php b/src/Elasticsearch/Endpoints/Cluster/Nodes/HotThreads.php index 4ed71649d..eeb4a96ac 100644 --- a/src/Elasticsearch/Endpoints/Cluster/Nodes/HotThreads.php +++ b/src/Elasticsearch/Endpoints/Cluster/Nodes/HotThreads.php @@ -16,7 +16,7 @@ class HotThreads extends AbstractNodesEndpoint /** * @return string */ - protected function getURI() + public function getURI() { $node_id = $this->nodeID; $uri = "/_cluster/nodes/hotthreads"; @@ -31,7 +31,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'interval', @@ -44,7 +44,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Cluster/Nodes/Info.php b/src/Elasticsearch/Endpoints/Cluster/Nodes/Info.php index 07001410e..bde5305b4 100644 --- a/src/Elasticsearch/Endpoints/Cluster/Nodes/Info.php +++ b/src/Elasticsearch/Endpoints/Cluster/Nodes/Info.php @@ -39,7 +39,7 @@ public function setMetric($metric) /** * @return string */ - protected function getURI() + public function getURI() { $node_id = $this->nodeID; $metric = $this->metric; @@ -59,7 +59,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'flat_settings', @@ -70,7 +70,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Cluster/Nodes/Shutdown.php b/src/Elasticsearch/Endpoints/Cluster/Nodes/Shutdown.php index dea6da108..6b7a6f2c8 100644 --- a/src/Elasticsearch/Endpoints/Cluster/Nodes/Shutdown.php +++ b/src/Elasticsearch/Endpoints/Cluster/Nodes/Shutdown.php @@ -16,7 +16,7 @@ class Shutdown extends AbstractNodesEndpoint /** * @return string */ - protected function getURI() + public function getURI() { $node_id = $this->nodeID; $uri = "/_shutdown"; @@ -31,7 +31,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'delay', @@ -42,7 +42,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'POST'; } diff --git a/src/Elasticsearch/Endpoints/Cluster/Nodes/Stats.php b/src/Elasticsearch/Endpoints/Cluster/Nodes/Stats.php index 257672afe..90da06ca2 100644 --- a/src/Elasticsearch/Endpoints/Cluster/Nodes/Stats.php +++ b/src/Elasticsearch/Endpoints/Cluster/Nodes/Stats.php @@ -62,7 +62,7 @@ public function setIndexMetric($indexMetric) /** * @return string */ - protected function getURI() + public function getURI() { $metric = $this->metric; $index_metric = $this->indexMetric; @@ -87,7 +87,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'completion_fields', @@ -103,7 +103,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Cluster/PendingTasks.php b/src/Elasticsearch/Endpoints/Cluster/PendingTasks.php index 6c51ff7b2..3ceac3a07 100644 --- a/src/Elasticsearch/Endpoints/Cluster/PendingTasks.php +++ b/src/Elasticsearch/Endpoints/Cluster/PendingTasks.php @@ -18,7 +18,7 @@ class PendingTasks extends AbstractEndpoint /** * @return string */ - protected function getURI() + public function getURI() { $uri = "/_cluster/pending_tasks"; @@ -28,7 +28,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'local', @@ -39,7 +39,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Cluster/Reroute.php b/src/Elasticsearch/Endpoints/Cluster/Reroute.php index 1e2f55063..411305399 100644 --- a/src/Elasticsearch/Endpoints/Cluster/Reroute.php +++ b/src/Elasticsearch/Endpoints/Cluster/Reroute.php @@ -36,7 +36,7 @@ public function setBody($body) /** * @return string */ - protected function getURI() + public function getURI() { $uri = "/_cluster/reroute"; @@ -46,7 +46,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'dry_run', @@ -61,7 +61,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'POST'; } diff --git a/src/Elasticsearch/Endpoints/Cluster/Settings/Get.php b/src/Elasticsearch/Endpoints/Cluster/Settings/Get.php index 57a47f9ac..12a53492f 100644 --- a/src/Elasticsearch/Endpoints/Cluster/Settings/Get.php +++ b/src/Elasticsearch/Endpoints/Cluster/Settings/Get.php @@ -19,7 +19,7 @@ class Get extends AbstractEndpoint /** * @return string */ - protected function getURI() + public function getURI() { $uri = "/_cluster/settings"; @@ -29,7 +29,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'flat_settings', @@ -41,7 +41,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Cluster/Settings/Put.php b/src/Elasticsearch/Endpoints/Cluster/Settings/Put.php index c0e831e91..522e7b1d9 100644 --- a/src/Elasticsearch/Endpoints/Cluster/Settings/Put.php +++ b/src/Elasticsearch/Endpoints/Cluster/Settings/Put.php @@ -36,7 +36,7 @@ public function setBody($body) /** * @return string */ - protected function getURI() + public function getURI() { $uri = "/_cluster/settings"; @@ -46,7 +46,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'flat_settings', @@ -56,7 +56,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'PUT'; } diff --git a/src/Elasticsearch/Endpoints/Cluster/State.php b/src/Elasticsearch/Endpoints/Cluster/State.php index 343567281..94af3b19d 100644 --- a/src/Elasticsearch/Endpoints/Cluster/State.php +++ b/src/Elasticsearch/Endpoints/Cluster/State.php @@ -41,7 +41,7 @@ public function setMetric($metric) /** * @return string */ - protected function getURI() + public function getURI() { $index = $this->index; $metric = $this->metric; @@ -59,7 +59,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'local', @@ -75,7 +75,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Cluster/Stats.php b/src/Elasticsearch/Endpoints/Cluster/Stats.php index 4eb540a5b..729b611f3 100644 --- a/src/Elasticsearch/Endpoints/Cluster/Stats.php +++ b/src/Elasticsearch/Endpoints/Cluster/Stats.php @@ -37,7 +37,7 @@ public function setNodeID($node_id) /** * @return string */ - protected function getURI() + public function getURI() { $node_id = $this->nodeID; $uri = "/_cluster/stats"; @@ -52,7 +52,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'flat_settings', @@ -63,7 +63,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Count.php b/src/Elasticsearch/Endpoints/Count.php index cf7c331c6..7bedb4b33 100644 --- a/src/Elasticsearch/Endpoints/Count.php +++ b/src/Elasticsearch/Endpoints/Count.php @@ -35,7 +35,7 @@ public function setBody($body) /** * @return string */ - protected function getURI() + public function getURI() { $index = $this->index; $type = $this->type; @@ -55,7 +55,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'ignore_unavailable', @@ -79,7 +79,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/CountPercolate.php b/src/Elasticsearch/Endpoints/CountPercolate.php index 6564f73a4..f87d6b5e5 100644 --- a/src/Elasticsearch/Endpoints/CountPercolate.php +++ b/src/Elasticsearch/Endpoints/CountPercolate.php @@ -36,7 +36,7 @@ public function setBody($body) * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->index) !== true) { throw new Exceptions\RuntimeException( @@ -65,7 +65,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'routing', @@ -83,7 +83,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Delete.php b/src/Elasticsearch/Endpoints/Delete.php index ab6d838f0..3f51baead 100644 --- a/src/Elasticsearch/Endpoints/Delete.php +++ b/src/Elasticsearch/Endpoints/Delete.php @@ -19,7 +19,7 @@ class Delete extends AbstractEndpoint * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->id) !== true) { throw new Exceptions\RuntimeException( @@ -51,7 +51,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'consistency', @@ -68,7 +68,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'DELETE'; } diff --git a/src/Elasticsearch/Endpoints/Exists.php b/src/Elasticsearch/Endpoints/Exists.php index 38a5c0f34..8ab0bedbc 100644 --- a/src/Elasticsearch/Endpoints/Exists.php +++ b/src/Elasticsearch/Endpoints/Exists.php @@ -19,7 +19,7 @@ class Exists extends AbstractEndpoint * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->id) !== true) { throw new Exceptions\RuntimeException( @@ -51,7 +51,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'parent', @@ -65,7 +65,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'HEAD'; } diff --git a/src/Elasticsearch/Endpoints/Explain.php b/src/Elasticsearch/Endpoints/Explain.php index 242bd5d9d..7d1bb2e81 100644 --- a/src/Elasticsearch/Endpoints/Explain.php +++ b/src/Elasticsearch/Endpoints/Explain.php @@ -36,7 +36,7 @@ public function setBody($body) * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->id) !== true) { throw new Exceptions\RuntimeException( @@ -68,7 +68,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'analyze_wildcard', @@ -92,7 +92,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/FieldStats.php b/src/Elasticsearch/Endpoints/FieldStats.php index e44761b26..1ca80d83e 100644 --- a/src/Elasticsearch/Endpoints/FieldStats.php +++ b/src/Elasticsearch/Endpoints/FieldStats.php @@ -36,7 +36,7 @@ public function setBody($body) /** * @return string */ - protected function getURI() + public function getURI() { $index = $this->index; $uri = "/_field_stats"; @@ -51,7 +51,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'fields', @@ -66,7 +66,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Get.php b/src/Elasticsearch/Endpoints/Get.php index aed9fcb9b..f62be084c 100644 --- a/src/Elasticsearch/Endpoints/Get.php +++ b/src/Elasticsearch/Endpoints/Get.php @@ -45,7 +45,7 @@ public function checkOnlyExistance() * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->id) !== true) { throw new Exceptions\RuntimeException( @@ -81,7 +81,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'fields', @@ -101,7 +101,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { if ($this->checkOnlyExistance === true) { return 'HEAD'; diff --git a/src/Elasticsearch/Endpoints/Index.php b/src/Elasticsearch/Endpoints/Index.php index 2585706d3..e800efb0a 100644 --- a/src/Elasticsearch/Endpoints/Index.php +++ b/src/Elasticsearch/Endpoints/Index.php @@ -49,7 +49,7 @@ public function createIfAbsent() * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->index) !== true) { throw new Exceptions\RuntimeException( @@ -82,7 +82,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'consistency', @@ -104,7 +104,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { if (isset($this->id) === true) { return 'PUT'; @@ -117,7 +117,7 @@ protected function getMethod() * @return array * @throws \Elasticsearch\Common\Exceptions\RuntimeException */ - protected function getBody() + public function getBody() { if (isset($this->body) !== true) { throw new Exceptions\RuntimeException('Document body must be set for index request'); diff --git a/src/Elasticsearch/Endpoints/Indices/Alias/Delete.php b/src/Elasticsearch/Endpoints/Indices/Alias/Delete.php index 0c5d1b1a1..2ed46816d 100644 --- a/src/Elasticsearch/Endpoints/Indices/Alias/Delete.php +++ b/src/Elasticsearch/Endpoints/Indices/Alias/Delete.php @@ -39,7 +39,7 @@ public function setName($name) * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->index) !== true) { throw new Exceptions\RuntimeException( @@ -65,7 +65,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'timeout', @@ -76,7 +76,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'DELETE'; } diff --git a/src/Elasticsearch/Endpoints/Indices/Alias/Exists.php b/src/Elasticsearch/Endpoints/Indices/Alias/Exists.php index 159b5f2f7..abc978a19 100644 --- a/src/Elasticsearch/Endpoints/Indices/Alias/Exists.php +++ b/src/Elasticsearch/Endpoints/Indices/Alias/Exists.php @@ -37,7 +37,7 @@ public function setName($name) /** * @return string */ - protected function getURI() + public function getURI() { $index = $this->index; $name = $this->name; @@ -57,7 +57,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'ignore_unavailable', @@ -70,7 +70,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'HEAD'; } diff --git a/src/Elasticsearch/Endpoints/Indices/Alias/Get.php b/src/Elasticsearch/Endpoints/Indices/Alias/Get.php index 5bd483aef..8b2ae03a7 100644 --- a/src/Elasticsearch/Endpoints/Indices/Alias/Get.php +++ b/src/Elasticsearch/Endpoints/Indices/Alias/Get.php @@ -37,7 +37,7 @@ public function setName($name) /** * @return string */ - protected function getURI() + public function getURI() { $index = $this->index; $name = $this->name; @@ -57,7 +57,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'ignore_unavailable', @@ -70,7 +70,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Indices/Alias/Put.php b/src/Elasticsearch/Endpoints/Indices/Alias/Put.php index ed50814d7..a91d6254f 100644 --- a/src/Elasticsearch/Endpoints/Indices/Alias/Put.php +++ b/src/Elasticsearch/Endpoints/Indices/Alias/Put.php @@ -56,7 +56,7 @@ public function setName($name) * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->name) !== true) { throw new Exceptions\RuntimeException( @@ -79,7 +79,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'timeout', @@ -90,7 +90,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'PUT'; } diff --git a/src/Elasticsearch/Endpoints/Indices/Aliases/Get.php b/src/Elasticsearch/Endpoints/Indices/Aliases/Get.php index eef365b26..4e9287fdc 100644 --- a/src/Elasticsearch/Endpoints/Indices/Aliases/Get.php +++ b/src/Elasticsearch/Endpoints/Indices/Aliases/Get.php @@ -37,7 +37,7 @@ public function setName($name) /** * @return string */ - protected function getURI() + public function getURI() { $index = $this->index; $name = $this->name; @@ -57,7 +57,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'timeout', @@ -68,7 +68,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Indices/Aliases/Update.php b/src/Elasticsearch/Endpoints/Indices/Aliases/Update.php index 9a38e5de6..a715b0f98 100644 --- a/src/Elasticsearch/Endpoints/Indices/Aliases/Update.php +++ b/src/Elasticsearch/Endpoints/Indices/Aliases/Update.php @@ -36,7 +36,7 @@ public function setBody($body) /** * @return string */ - protected function getURI() + public function getURI() { $uri = "/_aliases"; @@ -46,7 +46,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'timeout', @@ -58,7 +58,7 @@ protected function getParamWhitelist() * @return array * @throws \Elasticsearch\Common\Exceptions\RuntimeException */ - protected function getBody() + public function getBody() { if (isset($this->body) !== true) { throw new Exceptions\RuntimeException('Body is required for Update Aliases'); @@ -70,7 +70,7 @@ protected function getBody() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'POST'; } diff --git a/src/Elasticsearch/Endpoints/Indices/Analyze.php b/src/Elasticsearch/Endpoints/Indices/Analyze.php index be55fb5a4..ac7787948 100644 --- a/src/Elasticsearch/Endpoints/Indices/Analyze.php +++ b/src/Elasticsearch/Endpoints/Indices/Analyze.php @@ -36,7 +36,7 @@ public function setBody($body) /** * @return string */ - protected function getURI() + public function getURI() { $index = $this->index; $uri = "/_analyze"; @@ -51,7 +51,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'analyzer', @@ -72,7 +72,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Indices/Cache/Clear.php b/src/Elasticsearch/Endpoints/Indices/Cache/Clear.php index b544dee7e..787072d51 100644 --- a/src/Elasticsearch/Endpoints/Indices/Cache/Clear.php +++ b/src/Elasticsearch/Endpoints/Indices/Cache/Clear.php @@ -18,7 +18,7 @@ class Clear extends AbstractEndpoint /** * @return string */ - protected function getURI() + public function getURI() { $index = $this->index; $uri = "/_cache/clear"; @@ -33,7 +33,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'field_data', @@ -55,7 +55,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'POST'; } diff --git a/src/Elasticsearch/Endpoints/Indices/ClearCache.php b/src/Elasticsearch/Endpoints/Indices/ClearCache.php index 9e43148d6..4b502ba5a 100644 --- a/src/Elasticsearch/Endpoints/Indices/ClearCache.php +++ b/src/Elasticsearch/Endpoints/Indices/ClearCache.php @@ -18,7 +18,7 @@ class ClearCache extends AbstractEndpoint /** * @return string */ - protected function getURI() + public function getURI() { $index = $this->index; $uri = "/_cache/clear"; @@ -33,7 +33,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'field_data', @@ -55,7 +55,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Indices/Close.php b/src/Elasticsearch/Endpoints/Indices/Close.php index f84f89e8b..3d5bf7e6f 100644 --- a/src/Elasticsearch/Endpoints/Indices/Close.php +++ b/src/Elasticsearch/Endpoints/Indices/Close.php @@ -20,7 +20,7 @@ class Close extends AbstractEndpoint * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->index) !== true) { throw new Exceptions\RuntimeException( @@ -40,7 +40,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'timeout', @@ -54,7 +54,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'POST'; } diff --git a/src/Elasticsearch/Endpoints/Indices/Create.php b/src/Elasticsearch/Endpoints/Indices/Create.php index 5cffa191c..da593cdcf 100644 --- a/src/Elasticsearch/Endpoints/Indices/Create.php +++ b/src/Elasticsearch/Endpoints/Indices/Create.php @@ -37,7 +37,7 @@ public function setBody($body) * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->index) !== true) { throw new Exceptions\RuntimeException( @@ -57,7 +57,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'timeout', @@ -69,7 +69,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { if (is_array($this->body) && isset($this->body['mappings']) === true) { return 'POST'; diff --git a/src/Elasticsearch/Endpoints/Indices/Delete.php b/src/Elasticsearch/Endpoints/Indices/Delete.php index 4b1cb71ce..b832e7114 100644 --- a/src/Elasticsearch/Endpoints/Indices/Delete.php +++ b/src/Elasticsearch/Endpoints/Indices/Delete.php @@ -18,7 +18,7 @@ class Delete extends AbstractEndpoint /** * @return string */ - protected function getURI() + public function getURI() { $index = $this->index; $uri = "/$index"; @@ -33,7 +33,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'timeout', @@ -44,7 +44,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'DELETE'; } diff --git a/src/Elasticsearch/Endpoints/Indices/Exists.php b/src/Elasticsearch/Endpoints/Indices/Exists.php index 87cd0f1ef..ac45e3f74 100644 --- a/src/Elasticsearch/Endpoints/Indices/Exists.php +++ b/src/Elasticsearch/Endpoints/Indices/Exists.php @@ -20,7 +20,7 @@ class Exists extends AbstractEndpoint * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->index) !== true) { throw new Exceptions\RuntimeException( @@ -40,7 +40,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'ignore_unavailable', @@ -53,7 +53,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'HEAD'; } diff --git a/src/Elasticsearch/Endpoints/Indices/Exists/Types.php b/src/Elasticsearch/Endpoints/Indices/Exists/Types.php index 37869e099..a5b4b67a6 100644 --- a/src/Elasticsearch/Endpoints/Indices/Exists/Types.php +++ b/src/Elasticsearch/Endpoints/Indices/Exists/Types.php @@ -20,7 +20,7 @@ class Types extends AbstractEndpoint * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->index) !== true) { throw new Exceptions\RuntimeException( @@ -44,7 +44,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'ignore_unavailable', @@ -56,7 +56,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'HEAD'; } diff --git a/src/Elasticsearch/Endpoints/Indices/Field/Get.php b/src/Elasticsearch/Endpoints/Indices/Field/Get.php index ab0785efc..c99123462 100644 --- a/src/Elasticsearch/Endpoints/Indices/Field/Get.php +++ b/src/Elasticsearch/Endpoints/Indices/Field/Get.php @@ -39,7 +39,7 @@ public function setField($field) * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->field) !== true) { throw new Exceptions\RuntimeException( @@ -67,7 +67,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'include_defaults', @@ -81,7 +81,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Indices/Flush.php b/src/Elasticsearch/Endpoints/Indices/Flush.php index 93c0854bf..f8d7c4b34 100644 --- a/src/Elasticsearch/Endpoints/Indices/Flush.php +++ b/src/Elasticsearch/Endpoints/Indices/Flush.php @@ -25,7 +25,7 @@ public function setSynced($synced) /** * @return string */ - protected function getURI() + public function getURI() { $index = $this->index; $uri = "/_flush"; @@ -44,7 +44,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'force', @@ -59,7 +59,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Indices/ForceMerge.php b/src/Elasticsearch/Endpoints/Indices/ForceMerge.php index b75b80a83..3e6e0b465 100644 --- a/src/Elasticsearch/Endpoints/Indices/ForceMerge.php +++ b/src/Elasticsearch/Endpoints/Indices/ForceMerge.php @@ -18,7 +18,7 @@ class ForceMerge extends AbstractEndpoint /** * @return string */ - protected function getURI() + public function getURI() { $index = $this->index; $uri = "/_forcemerge"; @@ -33,7 +33,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'flush', @@ -50,7 +50,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'POST'; } diff --git a/src/Elasticsearch/Endpoints/Indices/Gateway/Snapshot.php b/src/Elasticsearch/Endpoints/Indices/Gateway/Snapshot.php index bcd8c019e..b492ceae9 100644 --- a/src/Elasticsearch/Endpoints/Indices/Gateway/Snapshot.php +++ b/src/Elasticsearch/Endpoints/Indices/Gateway/Snapshot.php @@ -18,7 +18,7 @@ class Snapshot extends AbstractEndpoint /** * @return string */ - protected function getURI() + public function getURI() { $index = $this->index; $uri = "/_gateway/snapshot"; @@ -33,7 +33,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'ignore_unavailable', @@ -45,7 +45,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'POST'; } diff --git a/src/Elasticsearch/Endpoints/Indices/Get.php b/src/Elasticsearch/Endpoints/Indices/Get.php index b2779860a..58a7de7b0 100644 --- a/src/Elasticsearch/Endpoints/Indices/Get.php +++ b/src/Elasticsearch/Endpoints/Indices/Get.php @@ -22,7 +22,7 @@ class Get extends AbstractEndpoint * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->index) !== true) { throw new Exceptions\RuntimeException( @@ -58,7 +58,7 @@ public function setFeature($feature) /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'local', @@ -72,7 +72,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Indices/Mapping/Delete.php b/src/Elasticsearch/Endpoints/Indices/Mapping/Delete.php index abaf142f1..87ac13d98 100644 --- a/src/Elasticsearch/Endpoints/Indices/Mapping/Delete.php +++ b/src/Elasticsearch/Endpoints/Indices/Mapping/Delete.php @@ -20,7 +20,7 @@ class Delete extends AbstractEndpoint * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->index) !== true) { throw new Exceptions\RuntimeException( @@ -46,7 +46,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'master_timeout', @@ -56,7 +56,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'DELETE'; } diff --git a/src/Elasticsearch/Endpoints/Indices/Mapping/Get.php b/src/Elasticsearch/Endpoints/Indices/Mapping/Get.php index b2fa1facc..88568e6dc 100644 --- a/src/Elasticsearch/Endpoints/Indices/Mapping/Get.php +++ b/src/Elasticsearch/Endpoints/Indices/Mapping/Get.php @@ -18,7 +18,7 @@ class Get extends AbstractEndpoint /** * @return string */ - protected function getURI() + public function getURI() { $index = $this->index; $type = $this->type; @@ -38,7 +38,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'ignore_unavailable', @@ -52,7 +52,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Indices/Mapping/GetField.php b/src/Elasticsearch/Endpoints/Indices/Mapping/GetField.php index 689384a00..068be334d 100644 --- a/src/Elasticsearch/Endpoints/Indices/Mapping/GetField.php +++ b/src/Elasticsearch/Endpoints/Indices/Mapping/GetField.php @@ -43,7 +43,7 @@ public function setFields($fields) * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->fields) !== true) { throw new Exceptions\RuntimeException( @@ -58,7 +58,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'include_defaults', @@ -72,7 +72,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Indices/Mapping/Put.php b/src/Elasticsearch/Endpoints/Indices/Mapping/Put.php index cf827b757..1639ca72b 100644 --- a/src/Elasticsearch/Endpoints/Indices/Mapping/Put.php +++ b/src/Elasticsearch/Endpoints/Indices/Mapping/Put.php @@ -37,7 +37,7 @@ public function setBody($body) * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->type) !== true) { throw new Exceptions\RuntimeException( @@ -60,7 +60,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'ignore_conflicts', @@ -77,7 +77,7 @@ protected function getParamWhitelist() * @return array * @throws \Elasticsearch\Common\Exceptions\RuntimeException */ - protected function getBody() + public function getBody() { if (isset($this->body) !== true) { throw new Exceptions\RuntimeException('Body is required for Put Mapping'); @@ -89,7 +89,7 @@ protected function getBody() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'PUT'; } diff --git a/src/Elasticsearch/Endpoints/Indices/Open.php b/src/Elasticsearch/Endpoints/Indices/Open.php index 6becfc354..6808659b5 100644 --- a/src/Elasticsearch/Endpoints/Indices/Open.php +++ b/src/Elasticsearch/Endpoints/Indices/Open.php @@ -20,7 +20,7 @@ class Open extends AbstractEndpoint * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->index) !== true) { throw new Exceptions\RuntimeException( @@ -40,7 +40,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'timeout', @@ -54,7 +54,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'POST'; } diff --git a/src/Elasticsearch/Endpoints/Indices/Recovery.php b/src/Elasticsearch/Endpoints/Indices/Recovery.php index 865b6af1b..11e11cf69 100644 --- a/src/Elasticsearch/Endpoints/Indices/Recovery.php +++ b/src/Elasticsearch/Endpoints/Indices/Recovery.php @@ -18,7 +18,7 @@ class Recovery extends AbstractEndpoint /** * @return string */ - protected function getURI() + public function getURI() { $index = $this->index; $uri = "/_recovery"; @@ -33,7 +33,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'detailed', @@ -45,7 +45,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Indices/Refresh.php b/src/Elasticsearch/Endpoints/Indices/Refresh.php index 187cf51dc..e7938d151 100644 --- a/src/Elasticsearch/Endpoints/Indices/Refresh.php +++ b/src/Elasticsearch/Endpoints/Indices/Refresh.php @@ -18,7 +18,7 @@ class Refresh extends AbstractEndpoint /** * @return string */ - protected function getURI() + public function getURI() { $index = $this->index; $uri = "/_refresh"; @@ -33,7 +33,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'ignore_unavailable', @@ -47,7 +47,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Indices/Rollover.php b/src/Elasticsearch/Endpoints/Indices/Rollover.php index 43d2461a5..b8d733157 100644 --- a/src/Elasticsearch/Endpoints/Indices/Rollover.php +++ b/src/Elasticsearch/Endpoints/Indices/Rollover.php @@ -70,7 +70,7 @@ public function setBody($body) * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->alias) !== true) { throw new Exceptions\RuntimeException( @@ -90,7 +90,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'timeout', @@ -101,7 +101,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'POST'; } diff --git a/src/Elasticsearch/Endpoints/Indices/Seal.php b/src/Elasticsearch/Endpoints/Indices/Seal.php index 5983c5b02..c6f513829 100644 --- a/src/Elasticsearch/Endpoints/Indices/Seal.php +++ b/src/Elasticsearch/Endpoints/Indices/Seal.php @@ -20,7 +20,7 @@ class Seal extends AbstractEndpoint * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { $index = $this->index; $uri = "/_seal"; @@ -35,7 +35,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array(); } @@ -43,7 +43,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'POST'; } diff --git a/src/Elasticsearch/Endpoints/Indices/Segments.php b/src/Elasticsearch/Endpoints/Indices/Segments.php index 9fa40c5c6..8ade2912e 100644 --- a/src/Elasticsearch/Endpoints/Indices/Segments.php +++ b/src/Elasticsearch/Endpoints/Indices/Segments.php @@ -18,7 +18,7 @@ class Segments extends AbstractEndpoint /** * @return string */ - protected function getURI() + public function getURI() { $index = $this->index; $uri = "/_segments"; @@ -33,7 +33,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'ignore_unavailable', @@ -47,7 +47,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Indices/Settings/Get.php b/src/Elasticsearch/Endpoints/Indices/Settings/Get.php index d349a6439..943bfd983 100644 --- a/src/Elasticsearch/Endpoints/Indices/Settings/Get.php +++ b/src/Elasticsearch/Endpoints/Indices/Settings/Get.php @@ -37,7 +37,7 @@ public function setName($name) /** * @return string */ - protected function getURI() + public function getURI() { $index = $this->index; $name = $this->name; @@ -57,7 +57,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'ignore_unavailable', @@ -72,7 +72,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Indices/Settings/Put.php b/src/Elasticsearch/Endpoints/Indices/Settings/Put.php index 7fd606d25..57f211a31 100644 --- a/src/Elasticsearch/Endpoints/Indices/Settings/Put.php +++ b/src/Elasticsearch/Endpoints/Indices/Settings/Put.php @@ -36,7 +36,7 @@ public function setBody($body) /** * @return string */ - protected function getURI() + public function getURI() { $index = $this->index; $uri = "/_settings"; @@ -51,7 +51,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'master_timeout', @@ -67,7 +67,7 @@ protected function getParamWhitelist() * @return array * @throws \Elasticsearch\Common\Exceptions\RuntimeException */ - protected function getBody() + public function getBody() { if (isset($this->body) !== true) { throw new Exceptions\RuntimeException('Body is required for Put Settings'); @@ -79,7 +79,7 @@ protected function getBody() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'PUT'; } diff --git a/src/Elasticsearch/Endpoints/Indices/ShardStores.php b/src/Elasticsearch/Endpoints/Indices/ShardStores.php index 438c2bb55..10dc44726 100644 --- a/src/Elasticsearch/Endpoints/Indices/ShardStores.php +++ b/src/Elasticsearch/Endpoints/Indices/ShardStores.php @@ -21,7 +21,7 @@ class ShardStores extends AbstractEndpoint * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { $index = $this->index; $uri = "/_shard_stores"; @@ -37,7 +37,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'status', @@ -52,7 +52,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Indices/Shrink.php b/src/Elasticsearch/Endpoints/Indices/Shrink.php index 9182acbd5..b4e7832b7 100644 --- a/src/Elasticsearch/Endpoints/Indices/Shrink.php +++ b/src/Elasticsearch/Endpoints/Indices/Shrink.php @@ -57,7 +57,7 @@ public function setTarget($target) * * @return string */ - protected function getURI() + public function getURI() { if (isset($this->index) !== true) { throw new Exceptions\RuntimeException( @@ -82,7 +82,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'timeout', @@ -93,7 +93,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { //TODO Fix Me! return 'PUT'; diff --git a/src/Elasticsearch/Endpoints/Indices/Snapshotindex.php b/src/Elasticsearch/Endpoints/Indices/Snapshotindex.php index 4d1e71a82..e30530b1d 100644 --- a/src/Elasticsearch/Endpoints/Indices/Snapshotindex.php +++ b/src/Elasticsearch/Endpoints/Indices/Snapshotindex.php @@ -18,7 +18,7 @@ class Snapshotindex extends AbstractEndpoint /** * @return string */ - protected function getURI() + public function getURI() { $index = $this->index; $uri = "/_gateway/snapshot"; @@ -33,7 +33,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'ignore_unavailable', @@ -45,7 +45,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'POST'; } diff --git a/src/Elasticsearch/Endpoints/Indices/Stats.php b/src/Elasticsearch/Endpoints/Indices/Stats.php index dea6ce0fa..899afc6df 100644 --- a/src/Elasticsearch/Endpoints/Indices/Stats.php +++ b/src/Elasticsearch/Endpoints/Indices/Stats.php @@ -41,7 +41,7 @@ public function setMetric($metric) /** * @return string */ - protected function getURI() + public function getURI() { $index = $this->index; $metric = $this->metric; @@ -61,7 +61,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'completion_fields', @@ -78,7 +78,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Indices/Status.php b/src/Elasticsearch/Endpoints/Indices/Status.php index 035006f7c..fc52f84e5 100644 --- a/src/Elasticsearch/Endpoints/Indices/Status.php +++ b/src/Elasticsearch/Endpoints/Indices/Status.php @@ -18,7 +18,7 @@ class Status extends AbstractEndpoint /** * @return string */ - protected function getURI() + public function getURI() { $index = $this->index; $uri = "/_status"; @@ -33,7 +33,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'ignore_unavailable', @@ -49,7 +49,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Indices/Template/Delete.php b/src/Elasticsearch/Endpoints/Indices/Template/Delete.php index 513991f23..044dce6f1 100644 --- a/src/Elasticsearch/Endpoints/Indices/Template/Delete.php +++ b/src/Elasticsearch/Endpoints/Indices/Template/Delete.php @@ -40,7 +40,7 @@ public function setName($name) * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->name) !== true) { throw new Exceptions\RuntimeException( @@ -60,7 +60,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'timeout', @@ -71,7 +71,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'DELETE'; } diff --git a/src/Elasticsearch/Endpoints/Indices/Template/Exists.php b/src/Elasticsearch/Endpoints/Indices/Template/Exists.php index 2efad46cd..ebf6fdfe3 100644 --- a/src/Elasticsearch/Endpoints/Indices/Template/Exists.php +++ b/src/Elasticsearch/Endpoints/Indices/Template/Exists.php @@ -39,7 +39,7 @@ public function setName($name) * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->name) !== true) { throw new Exceptions\RuntimeException( @@ -59,7 +59,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'local', @@ -70,7 +70,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'HEAD'; } diff --git a/src/Elasticsearch/Endpoints/Indices/Template/Get.php b/src/Elasticsearch/Endpoints/Indices/Template/Get.php index f34b8bfaf..77472063d 100644 --- a/src/Elasticsearch/Endpoints/Indices/Template/Get.php +++ b/src/Elasticsearch/Endpoints/Indices/Template/Get.php @@ -39,7 +39,7 @@ public function setName($name) * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { $name = $this->name; $uri = "/_template"; @@ -54,7 +54,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'flat_settings', @@ -66,7 +66,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Indices/Template/Put.php b/src/Elasticsearch/Endpoints/Indices/Template/Put.php index de0fca51e..3aca04607 100644 --- a/src/Elasticsearch/Endpoints/Indices/Template/Put.php +++ b/src/Elasticsearch/Endpoints/Indices/Template/Put.php @@ -56,7 +56,7 @@ public function setName($name) * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->name) !== true) { throw new Exceptions\RuntimeException( @@ -76,7 +76,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'order', @@ -91,7 +91,7 @@ protected function getParamWhitelist() * @return array * @throws \Elasticsearch\Common\Exceptions\RuntimeException */ - protected function getBody() + public function getBody() { if (isset($this->body) !== true) { throw new Exceptions\RuntimeException('Body is required for Put Template'); @@ -103,7 +103,7 @@ protected function getBody() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'PUT'; } diff --git a/src/Elasticsearch/Endpoints/Indices/Type/Exists.php b/src/Elasticsearch/Endpoints/Indices/Type/Exists.php index 5033a3663..9155b742a 100644 --- a/src/Elasticsearch/Endpoints/Indices/Type/Exists.php +++ b/src/Elasticsearch/Endpoints/Indices/Type/Exists.php @@ -20,7 +20,7 @@ class Exists extends AbstractEndpoint * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->index) !== true) { throw new Exceptions\RuntimeException( @@ -46,7 +46,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'ignore_unavailable', @@ -59,7 +59,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'HEAD'; } diff --git a/src/Elasticsearch/Endpoints/Indices/Upgrade/Get.php b/src/Elasticsearch/Endpoints/Indices/Upgrade/Get.php index 829c5bb4a..d9cb7bea2 100644 --- a/src/Elasticsearch/Endpoints/Indices/Upgrade/Get.php +++ b/src/Elasticsearch/Endpoints/Indices/Upgrade/Get.php @@ -26,7 +26,7 @@ class Get extends AbstractEndpoint /** * @return string */ - protected function getURI() + public function getURI() { $index = $this->index; $uri = "/_upgrade"; @@ -43,7 +43,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'wait_for_completion', @@ -58,7 +58,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Indices/Upgrade/Post.php b/src/Elasticsearch/Endpoints/Indices/Upgrade/Post.php index 2de64037b..5b00f68b6 100644 --- a/src/Elasticsearch/Endpoints/Indices/Upgrade/Post.php +++ b/src/Elasticsearch/Endpoints/Indices/Upgrade/Post.php @@ -26,7 +26,7 @@ class Post extends AbstractEndpoint /** * @return string */ - protected function getURI() + public function getURI() { $index = $this->index; $uri = "/_upgrade"; @@ -43,7 +43,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'wait_for_completion', @@ -58,7 +58,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'POST'; } diff --git a/src/Elasticsearch/Endpoints/Indices/Validate/Query.php b/src/Elasticsearch/Endpoints/Indices/Validate/Query.php index f71215ddc..a96303803 100644 --- a/src/Elasticsearch/Endpoints/Indices/Validate/Query.php +++ b/src/Elasticsearch/Endpoints/Indices/Validate/Query.php @@ -36,7 +36,7 @@ public function setBody($body) /** * @return string */ - protected function getURI() + public function getURI() { return $this->getOptionalURI('_validate/query'); } @@ -44,7 +44,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'explain', @@ -64,7 +64,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Indices/ValidateQuery.php b/src/Elasticsearch/Endpoints/Indices/ValidateQuery.php index 16196f368..df94c02a9 100644 --- a/src/Elasticsearch/Endpoints/Indices/ValidateQuery.php +++ b/src/Elasticsearch/Endpoints/Indices/ValidateQuery.php @@ -36,7 +36,7 @@ public function setBody($body) /** * @return string */ - protected function getURI() + public function getURI() { $index = $this->index; $type = $this->type; @@ -54,7 +54,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'explain', @@ -70,7 +70,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Info.php b/src/Elasticsearch/Endpoints/Info.php index b95a12bce..dc157d7bc 100644 --- a/src/Elasticsearch/Endpoints/Info.php +++ b/src/Elasticsearch/Endpoints/Info.php @@ -16,7 +16,7 @@ class Info extends AbstractEndpoint /** * @return string */ - protected function getURI() + public function getURI() { $uri = "/"; @@ -26,7 +26,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( ); @@ -35,7 +35,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Ingest/Pipeline/Delete.php b/src/Elasticsearch/Endpoints/Ingest/Pipeline/Delete.php index 0a9daec9a..b61e9e813 100644 --- a/src/Elasticsearch/Endpoints/Ingest/Pipeline/Delete.php +++ b/src/Elasticsearch/Endpoints/Ingest/Pipeline/Delete.php @@ -20,7 +20,7 @@ class Delete extends AbstractEndpoint * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->id) !== true) { throw new Exceptions\RuntimeException( @@ -36,7 +36,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'master_timeout', @@ -47,7 +47,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'DELETE'; } diff --git a/src/Elasticsearch/Endpoints/Ingest/Pipeline/Get.php b/src/Elasticsearch/Endpoints/Ingest/Pipeline/Get.php index 0e958cc24..5a89ea7c3 100644 --- a/src/Elasticsearch/Endpoints/Ingest/Pipeline/Get.php +++ b/src/Elasticsearch/Endpoints/Ingest/Pipeline/Get.php @@ -20,7 +20,7 @@ class Get extends AbstractEndpoint * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->id) !== true) { throw new Exceptions\RuntimeException( @@ -36,7 +36,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'master_timeout' @@ -46,7 +46,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Ingest/Pipeline/Put.php b/src/Elasticsearch/Endpoints/Ingest/Pipeline/Put.php index dbaf5a888..d8707b3cb 100644 --- a/src/Elasticsearch/Endpoints/Ingest/Pipeline/Put.php +++ b/src/Elasticsearch/Endpoints/Ingest/Pipeline/Put.php @@ -37,7 +37,7 @@ public function setBody($body) * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->id) !== true) { throw new Exceptions\RuntimeException( @@ -53,7 +53,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'master_timeout', @@ -64,7 +64,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'PUT'; } diff --git a/src/Elasticsearch/Endpoints/Ingest/Simulate.php b/src/Elasticsearch/Endpoints/Ingest/Simulate.php index 5f86ee4cc..f4570bbdf 100644 --- a/src/Elasticsearch/Endpoints/Ingest/Simulate.php +++ b/src/Elasticsearch/Endpoints/Ingest/Simulate.php @@ -37,7 +37,7 @@ public function setBody($body) * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->id) === true) { return "/_ingest/pipeline/{$this->id}/_simulate"; @@ -48,7 +48,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'verbose', @@ -58,7 +58,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/MPercolate.php b/src/Elasticsearch/Endpoints/MPercolate.php index ea916855b..47d20a88f 100644 --- a/src/Elasticsearch/Endpoints/MPercolate.php +++ b/src/Elasticsearch/Endpoints/MPercolate.php @@ -17,13 +17,11 @@ class MPercolate extends AbstractEndpoint implements BulkEndpointInterface { /** - * @param Transport $transport * @param SerializerInterface $serializer */ - public function __construct(Transport $transport, SerializerInterface $serializer) + public function __construct(SerializerInterface $serializer) { $this->serializer = $serializer; - parent::__construct($transport); } /** @@ -53,7 +51,7 @@ public function setBody($body) /** * @return string */ - protected function getURI() + public function getURI() { return $this->getOptionalURI('_mpercolate'); } @@ -61,7 +59,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'ignore_unavailable', @@ -73,7 +71,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'POST'; } diff --git a/src/Elasticsearch/Endpoints/MTermVectors.php b/src/Elasticsearch/Endpoints/MTermVectors.php index 466554abb..e723920d9 100644 --- a/src/Elasticsearch/Endpoints/MTermVectors.php +++ b/src/Elasticsearch/Endpoints/MTermVectors.php @@ -35,7 +35,7 @@ public function setBody($body) /** * @return string */ - protected function getURI() + public function getURI() { return $this->getOptionalURI('_mtermvectors'); } @@ -43,7 +43,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'ids', @@ -63,7 +63,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'POST'; } diff --git a/src/Elasticsearch/Endpoints/Mget.php b/src/Elasticsearch/Endpoints/Mget.php index dc21c10a4..715fbb5a0 100644 --- a/src/Elasticsearch/Endpoints/Mget.php +++ b/src/Elasticsearch/Endpoints/Mget.php @@ -35,7 +35,7 @@ public function setBody($body) /** * @return string */ - protected function getURI() + public function getURI() { $index = $this->index; $type = $this->type; @@ -55,7 +55,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'fields', @@ -73,7 +73,7 @@ protected function getParamWhitelist() * @return array * @throws \Elasticsearch\Common\Exceptions\RuntimeException */ - protected function getBody() + public function getBody() { if (isset($this->body) !== true) { throw new Exceptions\RuntimeException('Body is required for MGet'); @@ -85,7 +85,7 @@ protected function getBody() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'POST'; } diff --git a/src/Elasticsearch/Endpoints/Msearch.php b/src/Elasticsearch/Endpoints/Msearch.php index f71afe917..b4b4d1e82 100644 --- a/src/Elasticsearch/Endpoints/Msearch.php +++ b/src/Elasticsearch/Endpoints/Msearch.php @@ -18,13 +18,11 @@ class Msearch extends AbstractEndpoint { /** - * @param Transport $transport * @param SerializerInterface $serializer */ - public function __construct(Transport $transport, SerializerInterface $serializer) + public function __construct(SerializerInterface $serializer) { $this->serializer = $serializer; - parent::__construct($transport); } /** @@ -55,7 +53,7 @@ public function setBody($body) /** * @return string */ - protected function getURI() + public function getURI() { $index = $this->index; $type = $this->type; @@ -75,7 +73,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'search_type', @@ -86,7 +84,7 @@ protected function getParamWhitelist() * @return array * @throws \Elasticsearch\Common\Exceptions\RuntimeException */ - protected function getBody() + public function getBody() { if (isset($this->body) !== true) { throw new Exceptions\RuntimeException('Body is required for MSearch'); @@ -98,7 +96,7 @@ protected function getBody() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Percolate.php b/src/Elasticsearch/Endpoints/Percolate.php index 7337edaa8..4418d7dc4 100644 --- a/src/Elasticsearch/Endpoints/Percolate.php +++ b/src/Elasticsearch/Endpoints/Percolate.php @@ -36,7 +36,7 @@ public function setBody($body) * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->index) !== true) { throw new Exceptions\RuntimeException( @@ -63,7 +63,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'routing', @@ -83,7 +83,7 @@ protected function getParamWhitelist() * @return array * @throws \Elasticsearch\Common\Exceptions\RuntimeException */ - protected function getBody() + public function getBody() { return $this->body; } @@ -91,7 +91,7 @@ protected function getBody() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Ping.php b/src/Elasticsearch/Endpoints/Ping.php index 5e3d71f8c..a11d90287 100644 --- a/src/Elasticsearch/Endpoints/Ping.php +++ b/src/Elasticsearch/Endpoints/Ping.php @@ -16,7 +16,7 @@ class Ping extends AbstractEndpoint /** * @return string */ - protected function getURI() + public function getURI() { $uri = "/"; @@ -26,7 +26,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( ); @@ -35,7 +35,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'HEAD'; } diff --git a/src/Elasticsearch/Endpoints/Reindex.php b/src/Elasticsearch/Endpoints/Reindex.php index 265a6e27b..5f8b97c86 100644 --- a/src/Elasticsearch/Endpoints/Reindex.php +++ b/src/Elasticsearch/Endpoints/Reindex.php @@ -17,7 +17,7 @@ class Reindex extends AbstractEndpoint /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'refresh', @@ -31,7 +31,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getURI() + public function getURI() { return '/_reindex'; } @@ -39,7 +39,7 @@ protected function getURI() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'POST'; } diff --git a/src/Elasticsearch/Endpoints/RenderSearchTemplate.php b/src/Elasticsearch/Endpoints/RenderSearchTemplate.php index 12a4ceade..c31eb7238 100644 --- a/src/Elasticsearch/Endpoints/RenderSearchTemplate.php +++ b/src/Elasticsearch/Endpoints/RenderSearchTemplate.php @@ -37,7 +37,7 @@ public function setBody($body) * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { $id = $this->id; @@ -53,7 +53,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array(); } @@ -62,7 +62,7 @@ protected function getParamWhitelist() * @return array * @throws \Elasticsearch\Common\Exceptions\RuntimeException */ - protected function getBody() + public function getBody() { return $this->body; } @@ -70,7 +70,7 @@ protected function getBody() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Script/Delete.php b/src/Elasticsearch/Endpoints/Script/Delete.php index 33b303dc0..887c9f8b9 100644 --- a/src/Elasticsearch/Endpoints/Script/Delete.php +++ b/src/Elasticsearch/Endpoints/Script/Delete.php @@ -39,7 +39,7 @@ public function setLang($lang) * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->lang) !== true) { throw new Exceptions\RuntimeException( @@ -61,7 +61,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'version', @@ -72,7 +72,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'DELETE'; } diff --git a/src/Elasticsearch/Endpoints/Script/Get.php b/src/Elasticsearch/Endpoints/Script/Get.php index e28c5b404..78c01c8c5 100644 --- a/src/Elasticsearch/Endpoints/Script/Get.php +++ b/src/Elasticsearch/Endpoints/Script/Get.php @@ -39,7 +39,7 @@ public function setLang($lang) * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->lang) !== true) { throw new Exceptions\RuntimeException( @@ -61,7 +61,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'version_type', @@ -72,7 +72,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Script/Put.php b/src/Elasticsearch/Endpoints/Script/Put.php index c06ff345f..d10603e30 100644 --- a/src/Elasticsearch/Endpoints/Script/Put.php +++ b/src/Elasticsearch/Endpoints/Script/Put.php @@ -55,7 +55,7 @@ public function setBody($body) * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->lang) !== true) { throw new Exceptions\RuntimeException( @@ -77,7 +77,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'version_type', @@ -89,7 +89,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'PUT'; } diff --git a/src/Elasticsearch/Endpoints/Scroll.php b/src/Elasticsearch/Endpoints/Scroll.php index 2bb68b285..65aab8ddc 100644 --- a/src/Elasticsearch/Endpoints/Scroll.php +++ b/src/Elasticsearch/Endpoints/Scroll.php @@ -37,7 +37,7 @@ public function setBody($body) /** * @return array */ - protected function getBody() + public function getBody() { return $this->body; } @@ -68,7 +68,7 @@ public function setScrollId($scroll_id) /** * @return string */ - protected function getURI() + public function getURI() { $uri = "/_search/scroll"; return $uri; @@ -77,7 +77,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'scroll', @@ -87,7 +87,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { if ($this->clear == true) { return 'DELETE'; diff --git a/src/Elasticsearch/Endpoints/Search.php b/src/Elasticsearch/Endpoints/Search.php index b4e0ef8f9..caf955ebd 100644 --- a/src/Elasticsearch/Endpoints/Search.php +++ b/src/Elasticsearch/Endpoints/Search.php @@ -36,7 +36,7 @@ public function setBody($body) /** * @return string */ - protected function getURI() + public function getURI() { $index = $this->index; $type = $this->type; @@ -56,7 +56,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'analyzer', @@ -100,7 +100,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/SearchShards.php b/src/Elasticsearch/Endpoints/SearchShards.php index 9cc314c20..85c564adb 100644 --- a/src/Elasticsearch/Endpoints/SearchShards.php +++ b/src/Elasticsearch/Endpoints/SearchShards.php @@ -16,7 +16,7 @@ class SearchShards extends AbstractEndpoint /** * @return string */ - protected function getURI() + public function getURI() { $index = $this->index; $type = $this->type; @@ -36,7 +36,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'preference', @@ -51,7 +51,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/SearchTemplate.php b/src/Elasticsearch/Endpoints/SearchTemplate.php index aa24b2580..7b5c83048 100644 --- a/src/Elasticsearch/Endpoints/SearchTemplate.php +++ b/src/Elasticsearch/Endpoints/SearchTemplate.php @@ -36,7 +36,7 @@ public function setBody($body) /** * @return string */ - protected function getURI() + public function getURI() { $index = $this->index; $type = $this->type; @@ -56,7 +56,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'ignore_unavailable', @@ -72,7 +72,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Snapshot/Create.php b/src/Elasticsearch/Endpoints/Snapshot/Create.php index 975e45e8f..a00a1cead 100644 --- a/src/Elasticsearch/Endpoints/Snapshot/Create.php +++ b/src/Elasticsearch/Endpoints/Snapshot/Create.php @@ -75,7 +75,7 @@ public function setSnapshot($snapshot) * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->repository) !== true) { throw new Exceptions\RuntimeException( @@ -101,7 +101,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'master_timeout', @@ -112,7 +112,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'PUT'; } diff --git a/src/Elasticsearch/Endpoints/Snapshot/Delete.php b/src/Elasticsearch/Endpoints/Snapshot/Delete.php index e5658411d..ca28cfc10 100644 --- a/src/Elasticsearch/Endpoints/Snapshot/Delete.php +++ b/src/Elasticsearch/Endpoints/Snapshot/Delete.php @@ -58,7 +58,7 @@ public function setSnapshot($snapshot) * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->repository) !== true) { throw new Exceptions\RuntimeException( @@ -84,7 +84,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'master_timeout', @@ -94,7 +94,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'DELETE'; } diff --git a/src/Elasticsearch/Endpoints/Snapshot/Get.php b/src/Elasticsearch/Endpoints/Snapshot/Get.php index 0cf4ca4c7..920b9ef1a 100644 --- a/src/Elasticsearch/Endpoints/Snapshot/Get.php +++ b/src/Elasticsearch/Endpoints/Snapshot/Get.php @@ -58,7 +58,7 @@ public function setSnapshot($snapshot) * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->repository) !== true) { throw new Exceptions\RuntimeException( @@ -84,7 +84,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'master_timeout', @@ -94,7 +94,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Snapshot/Repository/Create.php b/src/Elasticsearch/Endpoints/Snapshot/Repository/Create.php index cfc8248e7..94275c77b 100644 --- a/src/Elasticsearch/Endpoints/Snapshot/Repository/Create.php +++ b/src/Elasticsearch/Endpoints/Snapshot/Repository/Create.php @@ -56,7 +56,7 @@ public function setRepository($repository) * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->repository) !== true) { throw new Exceptions\RuntimeException( @@ -76,7 +76,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'master_timeout', @@ -88,7 +88,7 @@ protected function getParamWhitelist() * @return array * @throws \Elasticsearch\Common\Exceptions\RuntimeException */ - protected function getBody() + public function getBody() { if (isset($this->body) !== true) { throw new Exceptions\RuntimeException('Body is required for Create Repository'); @@ -100,7 +100,7 @@ protected function getBody() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'PUT'; } diff --git a/src/Elasticsearch/Endpoints/Snapshot/Repository/Delete.php b/src/Elasticsearch/Endpoints/Snapshot/Repository/Delete.php index de2c0fefa..4e0109f96 100644 --- a/src/Elasticsearch/Endpoints/Snapshot/Repository/Delete.php +++ b/src/Elasticsearch/Endpoints/Snapshot/Repository/Delete.php @@ -39,7 +39,7 @@ public function setRepository($repository) * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->repository) !== true) { throw new Exceptions\RuntimeException( @@ -59,7 +59,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'master_timeout', @@ -70,7 +70,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'DELETE'; } diff --git a/src/Elasticsearch/Endpoints/Snapshot/Repository/Get.php b/src/Elasticsearch/Endpoints/Snapshot/Repository/Get.php index ad4e1f8f3..57af42b36 100644 --- a/src/Elasticsearch/Endpoints/Snapshot/Repository/Get.php +++ b/src/Elasticsearch/Endpoints/Snapshot/Repository/Get.php @@ -37,7 +37,7 @@ public function setRepository($repository) /** * @return string */ - protected function getURI() + public function getURI() { $repository = $this->repository; $uri = "/_snapshot"; @@ -52,7 +52,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'master_timeout', @@ -63,7 +63,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Snapshot/Repository/Verify.php b/src/Elasticsearch/Endpoints/Snapshot/Repository/Verify.php index 6e0f0706f..ebd8fa3ee 100644 --- a/src/Elasticsearch/Endpoints/Snapshot/Repository/Verify.php +++ b/src/Elasticsearch/Endpoints/Snapshot/Repository/Verify.php @@ -39,7 +39,7 @@ public function setRepository($repository) * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { $repository = $this->repository; if (isset($this->repository) !== true) { @@ -56,7 +56,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'master_timeout', @@ -67,7 +67,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'POST'; } diff --git a/src/Elasticsearch/Endpoints/Snapshot/Restore.php b/src/Elasticsearch/Endpoints/Snapshot/Restore.php index 2f1f5c949..193d2031e 100644 --- a/src/Elasticsearch/Endpoints/Snapshot/Restore.php +++ b/src/Elasticsearch/Endpoints/Snapshot/Restore.php @@ -75,7 +75,7 @@ public function setSnapshot($snapshot) * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->repository) !== true) { throw new Exceptions\RuntimeException( @@ -101,7 +101,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'master_timeout', @@ -112,7 +112,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'POST'; } diff --git a/src/Elasticsearch/Endpoints/Snapshot/Status.php b/src/Elasticsearch/Endpoints/Snapshot/Status.php index e658f3686..55507048e 100644 --- a/src/Elasticsearch/Endpoints/Snapshot/Status.php +++ b/src/Elasticsearch/Endpoints/Snapshot/Status.php @@ -58,7 +58,7 @@ public function setSnapshot($snapshot) * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->snapshot) === true && isset($this->repository) !== true) { throw new Exceptions\RuntimeException( @@ -82,7 +82,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'master_timeout', @@ -92,7 +92,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Source/Get.php b/src/Elasticsearch/Endpoints/Source/Get.php index 1763580a1..0e8ac26b5 100644 --- a/src/Elasticsearch/Endpoints/Source/Get.php +++ b/src/Elasticsearch/Endpoints/Source/Get.php @@ -20,7 +20,7 @@ class Get extends AbstractEndpoint * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->id) !== true) { throw new Exceptions\RuntimeException( @@ -52,7 +52,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'parent', @@ -71,7 +71,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Suggest.php b/src/Elasticsearch/Endpoints/Suggest.php index 204c6a9be..658eead29 100644 --- a/src/Elasticsearch/Endpoints/Suggest.php +++ b/src/Elasticsearch/Endpoints/Suggest.php @@ -35,7 +35,7 @@ public function setBody($body) /** * @return string */ - protected function getURI() + public function getURI() { $index = $this->index; $uri = "/_suggest"; @@ -50,7 +50,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'ignore_unavailable', @@ -66,7 +66,7 @@ protected function getParamWhitelist() * @return array * @throws \Elasticsearch\Common\Exceptions\RuntimeException */ - protected function getBody() + public function getBody() { if (isset($this->body) !== true) { throw new Exceptions\RuntimeException('Body is required for Suggest'); @@ -78,7 +78,7 @@ protected function getBody() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Tasks/Cancel.php b/src/Elasticsearch/Endpoints/Tasks/Cancel.php index d3bef7e49..ff2405b2d 100644 --- a/src/Elasticsearch/Endpoints/Tasks/Cancel.php +++ b/src/Elasticsearch/Endpoints/Tasks/Cancel.php @@ -39,7 +39,7 @@ public function setTaskId($taskId) * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->id) === true) { return "/_tasks/{$this->taskId}/_cancel"; @@ -51,7 +51,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'node_id', @@ -64,7 +64,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'POST'; } diff --git a/src/Elasticsearch/Endpoints/Tasks/Get.php b/src/Elasticsearch/Endpoints/Tasks/Get.php index 6570cf94b..8652e39f2 100644 --- a/src/Elasticsearch/Endpoints/Tasks/Get.php +++ b/src/Elasticsearch/Endpoints/Tasks/Get.php @@ -39,7 +39,7 @@ public function setTaskId($taskId) * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->id) === true) { return "/_tasks/{$this->taskId}"; @@ -51,7 +51,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'node_id', @@ -68,7 +68,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Template/Delete.php b/src/Elasticsearch/Endpoints/Template/Delete.php index de3a8f60d..b3593ba27 100644 --- a/src/Elasticsearch/Endpoints/Template/Delete.php +++ b/src/Elasticsearch/Endpoints/Template/Delete.php @@ -20,7 +20,7 @@ class Delete extends AbstractEndpoint * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->id) !== true) { throw new Exceptions\RuntimeException( @@ -36,7 +36,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array(); } @@ -44,7 +44,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'DELETE'; } diff --git a/src/Elasticsearch/Endpoints/Template/Get.php b/src/Elasticsearch/Endpoints/Template/Get.php index d6155a57b..954ecdda1 100644 --- a/src/Elasticsearch/Endpoints/Template/Get.php +++ b/src/Elasticsearch/Endpoints/Template/Get.php @@ -20,7 +20,7 @@ class Get extends AbstractEndpoint * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->id) !== true) { throw new Exceptions\RuntimeException( @@ -36,7 +36,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array(); } @@ -44,7 +44,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'GET'; } diff --git a/src/Elasticsearch/Endpoints/Template/Put.php b/src/Elasticsearch/Endpoints/Template/Put.php index 2e2bb6fe5..075f41335 100644 --- a/src/Elasticsearch/Endpoints/Template/Put.php +++ b/src/Elasticsearch/Endpoints/Template/Put.php @@ -36,7 +36,7 @@ public function setBody($body) * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->id) !== true) { throw new Exceptions\RuntimeException( @@ -53,7 +53,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array(); } @@ -61,7 +61,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'PUT'; } diff --git a/src/Elasticsearch/Endpoints/TermVectors.php b/src/Elasticsearch/Endpoints/TermVectors.php index fb92882a1..5ac9569e3 100644 --- a/src/Elasticsearch/Endpoints/TermVectors.php +++ b/src/Elasticsearch/Endpoints/TermVectors.php @@ -36,7 +36,7 @@ public function setBody($body) * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->index) !== true) { throw new Exceptions\RuntimeException( @@ -65,7 +65,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'term_statistics', @@ -84,7 +84,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'POST'; } diff --git a/src/Elasticsearch/Endpoints/Update.php b/src/Elasticsearch/Endpoints/Update.php index 20243052b..f643b43cf 100644 --- a/src/Elasticsearch/Endpoints/Update.php +++ b/src/Elasticsearch/Endpoints/Update.php @@ -36,7 +36,7 @@ public function setBody($body) * @throws \Elasticsearch\Common\Exceptions\RuntimeException * @return string */ - protected function getURI() + public function getURI() { if (isset($this->id) !== true) { throw new Exceptions\RuntimeException( @@ -68,7 +68,7 @@ protected function getURI() /** * @return string[] */ - protected function getParamWhitelist() + public function getParamWhitelist() { return array( 'consistency', @@ -91,7 +91,7 @@ protected function getParamWhitelist() /** * @return string */ - protected function getMethod() + public function getMethod() { return 'POST'; } diff --git a/src/Elasticsearch/Namespaces/AbstractNamespace.php b/src/Elasticsearch/Namespaces/AbstractNamespace.php index 2487937cb..6ff424ecb 100644 --- a/src/Elasticsearch/Namespaces/AbstractNamespace.php +++ b/src/Elasticsearch/Namespaces/AbstractNamespace.php @@ -2,6 +2,7 @@ namespace Elasticsearch\Namespaces; +use Elasticsearch\Endpoints\AbstractEndpoint; use Elasticsearch\Transport; /** @@ -54,4 +55,21 @@ public function extractArgument(&$params, $arg) return null; } } + + /** + * @param $endpoint AbstractEndpoint + * + * @throws \Exception + * @return array + */ + protected function performRequest(AbstractEndpoint $endpoint) + { + return $this->transport->performRequest( + $endpoint->getMethod(), + $endpoint->getURI(), + $endpoint->getParams(), + $endpoint->getBody(), + $endpoint->getOptions() + ); + } } diff --git a/src/Elasticsearch/Namespaces/BooleanRequestWrapper.php b/src/Elasticsearch/Namespaces/BooleanRequestWrapper.php index cd4640499..81c7e858d 100644 --- a/src/Elasticsearch/Namespaces/BooleanRequestWrapper.php +++ b/src/Elasticsearch/Namespaces/BooleanRequestWrapper.php @@ -5,6 +5,7 @@ use Elasticsearch\Common\Exceptions\Missing404Exception; use Elasticsearch\Common\Exceptions\RoutingMissingException; use Elasticsearch\Endpoints\AbstractEndpoint; +use Elasticsearch\Transport; use GuzzleHttp\Ring\Future\FutureArrayInterface; /** @@ -26,10 +27,17 @@ trait BooleanRequestWrapper * @throws Missing404Exception * @throws RoutingMissingException */ - public static function performRequest(AbstractEndpoint $endpoint) + public static function performRequest(AbstractEndpoint $endpoint, Transport $transport) { try { - $response = $endpoint->performRequest(); + $response = $transport->performRequest( + $endpoint->getMethod(), + $endpoint->getURI(), + $endpoint->getParams(), + $endpoint->getBody(), + $endpoint->getOptions() + ); + $response = $endpoint->resultOrFuture($response); if (!($response instanceof FutureArrayInterface)) { if ($response['status'] === 200) { diff --git a/src/Elasticsearch/Namespaces/CatNamespace.php b/src/Elasticsearch/Namespaces/CatNamespace.php index 4509db9e7..6115e82f1 100644 --- a/src/Elasticsearch/Namespaces/CatNamespace.php +++ b/src/Elasticsearch/Namespaces/CatNamespace.php @@ -35,7 +35,7 @@ public function aliases($params = array()) $endpoint = $endpointBuilder('Cat\Aliases'); $endpoint->setName($name); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -63,7 +63,7 @@ public function allocation($params = array()) $endpoint = $endpointBuilder('Cat\Allocation'); $endpoint->setNodeID($nodeID); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -90,7 +90,7 @@ public function count($params = array()) $endpoint = $endpointBuilder('Cat\Count'); $endpoint->setIndex($index); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -115,7 +115,7 @@ public function health($params = array()) /** @var \Elasticsearch\Endpoints\Cat\Health $endpoint */ $endpoint = $endpointBuilder('Cat\Health'); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -135,7 +135,7 @@ public function help($params = array()) /** @var \Elasticsearch\Endpoints\Cat\Help $endpoint */ $endpoint = $endpointBuilder('Cat\Help'); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -164,7 +164,7 @@ public function indices($params = array()) $endpoint = $endpointBuilder('Cat\Indices'); $endpoint->setIndex($index); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -188,7 +188,7 @@ public function master($params = array()) /** @var \Elasticsearch\Endpoints\Cat\Master $endpoint */ $endpoint = $endpointBuilder('Cat\Master'); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -212,7 +212,7 @@ public function nodes($params = array()) /** @var \Elasticsearch\Endpoints\Cat\Nodes $endpoint */ $endpoint = $endpointBuilder('Cat\Nodes'); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -236,7 +236,7 @@ public function nodeAttrs($params = array()) /** @var \Elasticsearch\Endpoints\Cat\NodeAttrs $endpoint */ $endpoint = $endpointBuilder('Cat\NodeAttrs'); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -260,7 +260,7 @@ public function pendingTasks($params = array()) /** @var \Elasticsearch\Endpoints\Cat\PendingTasks $endpoint */ $endpoint = $endpointBuilder('Cat\PendingTasks'); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -288,7 +288,7 @@ public function recovery($params = array()) $endpoint = $endpointBuilder('Cat\Recovery'); $endpoint->setIndex($index); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -312,7 +312,7 @@ public function repositories($params = array()) /** @var \Elasticsearch\Endpoints\Cat\Repositories $endpoint */ $endpoint = $endpointBuilder('Cat\Repositories'); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -340,7 +340,7 @@ public function shards($params = array()) $endpoint = $endpointBuilder('Cat\Shards'); $endpoint->setIndex($index); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -369,7 +369,7 @@ public function snapshots($params = array()) $endpoint = $endpointBuilder('Cat\Snapshots'); $endpoint->setRepository($repository); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -398,7 +398,7 @@ public function threadPool($params = array()) $endpoint = $endpointBuilder('Cat\ThreadPool'); $endpoint->setIndex($index); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -427,7 +427,7 @@ public function fielddata($params = array()) $endpoint = $endpointBuilder('Cat\Fielddata'); $endpoint->setFields($fields); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -451,7 +451,7 @@ public function plugins($params = array()) /** @var \Elasticsearch\Endpoints\Cat\Plugins $endpoint */ $endpoint = $endpointBuilder('Cat\Plugins'); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -476,7 +476,7 @@ public function segments($params = array()) $endpoint = $endpointBuilder('Cat\Segments'); $endpoint->setIndex($index); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -505,7 +505,7 @@ public function tasks($params = array()) /** @var \Elasticsearch\Endpoints\Cat\Tasks $endpoint */ $endpoint = $endpointBuilder('Cat\Tasks'); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } diff --git a/src/Elasticsearch/Namespaces/ClusterNamespace.php b/src/Elasticsearch/Namespaces/ClusterNamespace.php index 4fb2b01ce..ad6a71264 100644 --- a/src/Elasticsearch/Namespaces/ClusterNamespace.php +++ b/src/Elasticsearch/Namespaces/ClusterNamespace.php @@ -39,7 +39,7 @@ public function health($params = array()) $endpoint = $endpointBuilder('Cluster\Health'); $endpoint->setIndex($index); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -65,7 +65,7 @@ public function reroute($params = array()) $endpoint = $endpointBuilder('Cluster\Reroute'); $endpoint->setBody($body); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -97,7 +97,7 @@ public function state($params = array()) $endpoint->setParams($params) ->setIndex($index) ->setMetric($metric); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -121,7 +121,7 @@ public function stats($params = array()) $endpoint = $endpointBuilder('Cluster\Stats'); $endpoint->setNodeID($nodeID) ->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -144,7 +144,7 @@ public function putSettings($params = array()) $endpoint = $endpointBuilder('Cluster\Settings\Put'); $endpoint->setBody($body); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -162,7 +162,7 @@ public function getSettings($params = array()) /** @var \Elasticsearch\Endpoints\Cluster\Settings\Put $endpoint */ $endpoint = $endpointBuilder('Cluster\Settings\Get'); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -183,7 +183,7 @@ public function pendingTasks($params = array()) /** @var \Elasticsearch\Endpoints\Cluster\PendingTasks $endpoint */ $endpoint = $endpointBuilder('Cluster\PendingTasks'); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -206,7 +206,7 @@ public function allocationExplain($params = array()) $endpoint = $endpointBuilder('Cluster\AllocationExplain'); $endpoint->setBody($body) ->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } diff --git a/src/Elasticsearch/Namespaces/IndicesNamespace.php b/src/Elasticsearch/Namespaces/IndicesNamespace.php index 99866a74f..e5b86c319 100644 --- a/src/Elasticsearch/Namespaces/IndicesNamespace.php +++ b/src/Elasticsearch/Namespaces/IndicesNamespace.php @@ -35,7 +35,7 @@ public function exists($params) $endpoint->setIndex($index); $endpoint->setParams($params); - return BooleanRequestWrapper::performRequest($endpoint); + return BooleanRequestWrapper::performRequest($endpoint, $this->transport); } /** @@ -64,7 +64,7 @@ public function get($params) ->setFeature($feature) ->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -91,7 +91,7 @@ public function segments($params = array()) $endpoint = $endpointBuilder('Indices\Segments'); $endpoint->setIndex($index); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -115,7 +115,7 @@ public function deleteTemplate($params) $endpoint = $endpointBuilder('Indices\Template\Delete'); $endpoint->setName($name); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -139,7 +139,7 @@ public function delete($params = array()) $endpoint = $endpointBuilder('Indices\Delete'); $endpoint->setIndex($index); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -184,7 +184,7 @@ public function stats($params = array()) $endpoint->setIndex($index) ->setMetric($metric); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -211,7 +211,7 @@ public function putSettings($params = array()) $endpoint->setIndex($index) ->setBody($body); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -237,7 +237,7 @@ public function snapshotIndex($params = array()) $endpoint = $endpointBuilder('Indices\Gateway\Snapshot'); $endpoint->setIndex($index); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -264,7 +264,7 @@ public function shrink($params = array()) $endpoint = $endpointBuilder('Indices\Shrink'); $endpoint->setIndex($index) ->setTarget($target); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -291,7 +291,7 @@ public function getMapping($params = array()) $endpoint->setIndex($index) ->setType($type); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -327,7 +327,7 @@ public function getFieldMapping($params = array()) ->setFields($fields); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -356,7 +356,7 @@ public function flush($params = array()) $endpoint = $endpointBuilder('Indices\Flush'); $endpoint->setIndex($index); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -386,7 +386,7 @@ public function flushSynced($params = array()) $endpoint->setIndex($index); $endpoint->setParams($params); $endpoint->setSynced(true); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -413,7 +413,7 @@ public function refresh($params = array()) $endpoint = $endpointBuilder('Indices\Refresh'); $endpoint->setIndex($index); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -439,7 +439,7 @@ public function recovery($params = array()) $endpoint = $endpointBuilder('Indices\Recovery'); $endpoint->setIndex($index); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -473,7 +473,7 @@ public function existsType($params) ->setType($type); $endpoint->setParams($params); - return BooleanRequestWrapper::performRequest($endpoint); + return BooleanRequestWrapper::performRequest($endpoint, $this->transport); } /** @@ -503,7 +503,7 @@ public function putAlias($params = array()) ->setName($name) ->setBody($body); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -533,7 +533,7 @@ public function putTemplate($params) $endpoint->setName($name) ->setBody($body); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -568,7 +568,7 @@ public function validateQuery($params = array()) ->setType($type) ->setBody($body); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -597,7 +597,7 @@ public function getAlias($params) $endpoint->setIndex($index) ->setName($name); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -630,7 +630,7 @@ public function putMapping($params) ->setType($type) ->setBody($body); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -657,7 +657,7 @@ public function deleteMapping($params) $endpoint->setIndex($index) ->setType($type); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -680,7 +680,7 @@ public function getTemplate($params) $endpoint = $endpointBuilder('Indices\Template\Get'); $endpoint->setName($name); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -707,7 +707,7 @@ public function existsTemplate($params) $endpoint->setName($name); $endpoint->setParams($params); - return BooleanRequestWrapper::performRequest($endpoint); + return BooleanRequestWrapper::performRequest($endpoint, $this->transport); } /** @@ -733,7 +733,7 @@ public function create($params) $endpoint->setIndex($index) ->setBody($body); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -765,7 +765,7 @@ public function forceMerge($params = array()) $endpoint = $endpointBuilder('Indices\ForceMerge'); $endpoint->setIndex($index); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -793,7 +793,7 @@ public function deleteAlias($params) $endpoint->setIndex($index) ->setName($name); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -817,7 +817,7 @@ public function open($params) $endpoint = $endpointBuilder('Indices\Open'); $endpoint->setIndex($index); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -855,7 +855,7 @@ public function analyze($params = array()) $endpoint->setIndex($index) ->setBody($body); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -890,7 +890,7 @@ public function clearCache($params = array()) $endpoint = $endpointBuilder('Indices\Cache\Clear'); $endpoint->setIndex($index); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -918,7 +918,7 @@ public function updateAliases($params = array()) $endpoint->setIndex($index) ->setBody($body); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -945,7 +945,7 @@ public function getAliases($params = array()) $endpoint->setIndex($index) ->setName($name); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -979,7 +979,7 @@ public function existsAlias($params) ->setName($name); $endpoint->setParams($params); - return BooleanRequestWrapper::performRequest($endpoint); + return BooleanRequestWrapper::performRequest($endpoint, $this->transport); } /** @@ -1004,7 +1004,7 @@ public function status($params = array()) $endpoint = $endpointBuilder('Indices\Status'); $endpoint->setIndex($index); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -1030,7 +1030,7 @@ public function getSettings($params = array()) $endpoint->setIndex($index) ->setName($name); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -1054,7 +1054,7 @@ public function close($params) $endpoint = $endpointBuilder('Indices\Close'); $endpoint->setIndex($index); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -1077,7 +1077,7 @@ public function seal($params) $endpoint = $endpointBuilder('Indices\Seal'); $endpoint->setIndex($index); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -1106,7 +1106,7 @@ public function upgrade($params = array()) $endpoint = $endpointBuilder('Indices\Upgrade\Post'); $endpoint->setIndex($index); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -1134,7 +1134,7 @@ public function getUpgrade($params = array()) $endpoint = $endpointBuilder('Indices\Upgrade\Get'); $endpoint->setIndex($index); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -1162,7 +1162,7 @@ public function shardStores($params) $endpoint = $endpointBuilder('Indices\ShardStores'); $endpoint->setIndex($index); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -1192,7 +1192,7 @@ public function rollover($params) ->setAlias($alias) ->setParams($params) ->setBody($body); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } diff --git a/src/Elasticsearch/Namespaces/IngestNamespace.php b/src/Elasticsearch/Namespaces/IngestNamespace.php index 864934650..98b36746b 100644 --- a/src/Elasticsearch/Namespaces/IngestNamespace.php +++ b/src/Elasticsearch/Namespaces/IngestNamespace.php @@ -37,7 +37,7 @@ public function deletePipeline($params = array()) $endpoint = $endpointBuilder('Ingest\Pipeline\Delete'); $endpoint->setID($id); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -60,7 +60,7 @@ public function getPipeline($params = array()) $endpoint = $endpointBuilder('Ingest\Pipeline\Get'); $endpoint->setID($id); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -86,7 +86,7 @@ public function putPipeline($params = array()) $endpoint->setID($id) ->setBody($body) ->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -111,7 +111,7 @@ public function simulate($params = array()) $endpoint->setID($id) ->setBody($body) ->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } diff --git a/src/Elasticsearch/Namespaces/NodesNamespace.php b/src/Elasticsearch/Namespaces/NodesNamespace.php index da8f58846..283e46c55 100644 --- a/src/Elasticsearch/Namespaces/NodesNamespace.php +++ b/src/Elasticsearch/Namespaces/NodesNamespace.php @@ -51,7 +51,7 @@ public function stats($params = array()) ->setMetric($metric) ->setIndexMetric($index_metric) ->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -79,7 +79,7 @@ public function info($params = array()) $endpoint = $endpointBuilder('Cluster\Nodes\Info'); $endpoint->setNodeID($nodeID)->setMetric($metric); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -106,7 +106,7 @@ public function hotThreads($params = array()) $endpoint = $endpointBuilder('Cluster\Nodes\HotThreads'); $endpoint->setNodeID($nodeID); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -131,7 +131,7 @@ public function shutdown($params = array()) $endpoint = $endpointBuilder('Cluster\Nodes\Shutdown'); $endpoint->setNodeID($nodeID); $endpoint->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } diff --git a/src/Elasticsearch/Namespaces/SnapshotNamespace.php b/src/Elasticsearch/Namespaces/SnapshotNamespace.php index 1251860c4..d4ab8f44f 100644 --- a/src/Elasticsearch/Namespaces/SnapshotNamespace.php +++ b/src/Elasticsearch/Namespaces/SnapshotNamespace.php @@ -36,7 +36,7 @@ public function create($params = array()) ->setSnapshot($snapshot) ->setParams($params) ->setBody($body); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint);; return $endpoint->resultOrFuture($response); } @@ -62,7 +62,7 @@ public function createRepository($params = array()) $endpoint->setRepository($repository) ->setBody($body) ->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint);; return $endpoint->resultOrFuture($response); } @@ -87,7 +87,7 @@ public function delete($params = array()) $endpoint->setRepository($repository) ->setSnapshot($snapshot) ->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint);; return $endpoint->resultOrFuture($response); } @@ -111,7 +111,7 @@ public function deleteRepository($params = array()) $endpoint = $endpointBuilder('Snapshot\Repository\Delete'); $endpoint->setRepository($repository) ->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint);; return $endpoint->resultOrFuture($response); } @@ -136,7 +136,7 @@ public function get($params = array()) $endpoint->setRepository($repository) ->setSnapshot($snapshot) ->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint);; return $endpoint->resultOrFuture($response); } @@ -160,7 +160,7 @@ public function getRepository($params = array()) $endpoint = $endpointBuilder('Snapshot\Repository\Get'); $endpoint->setRepository($repository) ->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint);; return $endpoint->resultOrFuture($response); } @@ -188,7 +188,7 @@ public function restore($params = array()) ->setSnapshot($snapshot) ->setParams($params) ->setBody($body); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint);; return $endpoint->resultOrFuture($response); } @@ -213,7 +213,7 @@ public function status($params = array()) $endpoint->setRepository($repository) ->setSnapshot($snapshot) ->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint);; return $endpoint->resultOrFuture($response); } @@ -237,7 +237,7 @@ public function verifyRepository($params = array()) $endpoint = $endpointBuilder('Snapshot\Repository\Verify'); $endpoint->setRepository($repository) ->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint);; return $endpoint->resultOrFuture($response); } diff --git a/src/Elasticsearch/Namespaces/TasksNamespace.php b/src/Elasticsearch/Namespaces/TasksNamespace.php index 0b662b11f..947ce5329 100644 --- a/src/Elasticsearch/Namespaces/TasksNamespace.php +++ b/src/Elasticsearch/Namespaces/TasksNamespace.php @@ -40,7 +40,7 @@ public function get($params = array()) $endpoint = $endpointBuilder('Tasks\Get'); $endpoint->setTaskId($id) ->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); } @@ -66,7 +66,7 @@ public function cancel($params = array()) $endpoint = $endpointBuilder('Tasks\Cancel'); $endpoint->setTaskId($id) ->setParams($params); - $response = $endpoint->performRequest(); + $response = $this->performRequest($endpoint); return $endpoint->resultOrFuture($response); }