Skip to content

Commit

Permalink
[BWC Break] Rename internal TermVector -> TermVectors, remove old pub…
Browse files Browse the repository at this point in the history
…lic TermVector
  • Loading branch information
polyfractal committed Jul 6, 2016
1 parent 1ba8299 commit cbe8619
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 17 deletions.
14 changes: 3 additions & 11 deletions src/Elasticsearch/Client.php
Expand Up @@ -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');
Expand All @@ -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)
Expand All @@ -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
Expand Down
Expand Up @@ -5,15 +5,15 @@
use Elasticsearch\Common\Exceptions;

/**
* Class TermVector
* Class TermVectors
*
* @category Elasticsearch
* @package Elasticsearch\Endpoints
* @author Zachary Tong <zach@elastic.co>
* @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
Expand All @@ -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;
}
Expand Down

0 comments on commit cbe8619

Please sign in to comment.