Skip to content

Commit cbe8619

Browse files
committed
[BWC Break] Rename internal TermVector -> TermVectors, remove old public TermVector
1 parent 1ba8299 commit cbe8619

File tree

2 files changed

+9
-17
lines changed

2 files changed

+9
-17
lines changed

src/Elasticsearch/Client.php

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ public function mpercolate($params = array())
451451
*
452452
* @return array
453453
*/
454-
public function termvector($params = array())
454+
public function termvectors($params = array())
455455
{
456456
$index = $this->extractArgument($params, 'index');
457457
$type = $this->extractArgument($params, 'type');
@@ -461,8 +461,8 @@ public function termvector($params = array())
461461
/** @var callback $endpointBuilder */
462462
$endpointBuilder = $this->endpoints;
463463

464-
/** @var \Elasticsearch\Endpoints\TermVector $endpoint */
465-
$endpoint = $endpointBuilder('TermVector');
464+
/** @var \Elasticsearch\Endpoints\TermVectors $endpoint */
465+
$endpoint = $endpointBuilder('TermVectors');
466466
$endpoint->setIndex($index)
467467
->setType($type)
468468
->setID($id)
@@ -473,14 +473,6 @@ public function termvector($params = array())
473473
return $endpoint->resultOrFuture($response);
474474
}
475475

476-
/**
477-
* Redirect to termvector, this is just a naming difference depending on version
478-
*/
479-
public function termvectors($params = array())
480-
{
481-
return $this->termvector($params);
482-
}
483-
484476
/**
485477
* $params['index'] = (string) Default index for items which don't provide one
486478
* ['type'] = (string) Default document type for items which don't provide one

src/Elasticsearch/Endpoints/TermVector.php renamed to src/Elasticsearch/Endpoints/TermVectors.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
use Elasticsearch\Common\Exceptions;
66

77
/**
8-
* Class TermVector
8+
* Class TermVectors
99
*
1010
* @category Elasticsearch
1111
* @package Elasticsearch\Endpoints
1212
* @author Zachary Tong <zach@elastic.co>
1313
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
1414
* @link http://elastic.co
1515
*/
16-
class TermVector extends AbstractEndpoint
16+
class TermVectors extends AbstractEndpoint
1717
{
1818
/**
1919
* @param array $body
@@ -40,24 +40,24 @@ protected function getURI()
4040
{
4141
if (isset($this->index) !== true) {
4242
throw new Exceptions\RuntimeException(
43-
'index is required for TermVector'
43+
'index is required for TermVectors'
4444
);
4545
}
4646
if (isset($this->type) !== true) {
4747
throw new Exceptions\RuntimeException(
48-
'type is required for TermVector'
48+
'type is required for TermVectors'
4949
);
5050
}
5151
if (isset($this->id) !== true) {
5252
throw new Exceptions\RuntimeException(
53-
'id is required for TermVector'
53+
'id is required for TermVectors'
5454
);
5555
}
5656

5757
$index = $this->index;
5858
$type = $this->type;
5959
$id = $this->id;
60-
$uri = "/$index/$type/$id/_termvector";
60+
$uri = "/$index/$type/$id/_termvectors";
6161

6262
return $uri;
6363
}

0 commit comments

Comments
 (0)