diff --git a/src/Elasticsearch/Client.php b/src/Elasticsearch/Client.php index 56b5ba1e5..e4b834257 100644 --- a/src/Elasticsearch/Client.php +++ b/src/Elasticsearch/Client.php @@ -451,7 +451,7 @@ public function mpercolate($params = array()) * * @return array */ - public function termvector($params = array()) + public function termvectors($params = array()) { $index = $this->extractArgument($params, 'index'); $type = $this->extractArgument($params, 'type'); @@ -461,8 +461,8 @@ public function termvector($params = array()) /** @var callback $endpointBuilder */ $endpointBuilder = $this->endpoints; - /** @var \Elasticsearch\Endpoints\TermVector $endpoint */ - $endpoint = $endpointBuilder('TermVector'); + /** @var \Elasticsearch\Endpoints\TermVectors $endpoint */ + $endpoint = $endpointBuilder('TermVectors'); $endpoint->setIndex($index) ->setType($type) ->setID($id) @@ -473,14 +473,6 @@ public function termvector($params = array()) return $endpoint->resultOrFuture($response); } - /** - * Redirect to termvector, this is just a naming difference depending on version - */ - public function termvectors($params = array()) - { - return $this->termvector($params); - } - /** * $params['index'] = (string) Default index for items which don't provide one * ['type'] = (string) Default document type for items which don't provide one diff --git a/src/Elasticsearch/Endpoints/TermVector.php b/src/Elasticsearch/Endpoints/TermVectors.php similarity index 86% rename from src/Elasticsearch/Endpoints/TermVector.php rename to src/Elasticsearch/Endpoints/TermVectors.php index 91e08980a..fb92882a1 100644 --- a/src/Elasticsearch/Endpoints/TermVector.php +++ b/src/Elasticsearch/Endpoints/TermVectors.php @@ -5,7 +5,7 @@ use Elasticsearch\Common\Exceptions; /** - * Class TermVector + * Class TermVectors * * @category Elasticsearch * @package Elasticsearch\Endpoints @@ -13,7 +13,7 @@ * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 * @link http://elastic.co */ -class TermVector extends AbstractEndpoint +class TermVectors extends AbstractEndpoint { /** * @param array $body @@ -40,24 +40,24 @@ protected function getURI() { if (isset($this->index) !== true) { throw new Exceptions\RuntimeException( - 'index is required for TermVector' + 'index is required for TermVectors' ); } if (isset($this->type) !== true) { throw new Exceptions\RuntimeException( - 'type is required for TermVector' + 'type is required for TermVectors' ); } if (isset($this->id) !== true) { throw new Exceptions\RuntimeException( - 'id is required for TermVector' + 'id is required for TermVectors' ); } $index = $this->index; $type = $this->type; $id = $this->id; - $uri = "/$index/$type/$id/_termvector"; + $uri = "/$index/$type/$id/_termvectors"; return $uri; }