Skip to content

Commit a13544f

Browse files
committed
Remove PutTemplate endpoint, lang param of PutScript no longer used
Fixes #686
1 parent 5a515ac commit a13544f

File tree

4 files changed

+4
-141
lines changed

4 files changed

+4
-141
lines changed

BREAKING_CHANGES.md

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,4 @@
1-
# 5.0
1+
# 6.0
22

3-
## Breaking changes
4-
5-
- Indices/Analyze Endpoint: `filters` and `char_filters` URI parameters have renamed to `filter` and `char_filter` respectively
6-
- SearchExists endpoint has been removed ([use `size=0` and `terminate_after=1` instead](https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking_50_search_changes.html#_search_exists_api_removed))
7-
- Warmers have been removed because they are [no longer useful](https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking_50_index_apis.html#_warmers)
8-
- Indices/Optimize Endpoint has been removed ([use `_forcemerge` instead](https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking_50_rest_api_changes.html#_literal__optimize_literal_endpoint_removed))
9-
- MoreLikeThis (MLT) endpoint has been removed
10-
- DeleteByQuery endpoint has been removed.
11-
- Tasks/List and Tasks/Get are now separate endpoints (see: [[e0cc5f9]](http://github.com/elasticsearch/elasticsearch-php/commit/752d5a2))
12-
- Client requires PHP 5.6.6 or higher
13-
14-
## Deprecations
15-
16-
- Percolator endpoints are deprecated and will be removed in Elasticsearch 6.0
17-
18-
## Internal BWC Breaks
19-
20-
- Namespace injection has changed slightly. If you use custom namespaces, you'll need to update your code (see: Add better ability to inject namespaces [[b1a27b7]](http://github.com/elasticsearch/elasticsearch-php/commit/b1a27b7))
21-
- Endpoints no longer use the Transport directly. If you use custom endpoints, you'll need to do some minor
22-
refactoring (see: Refactor to remove Transport dependence in endpoints [[ecd454c]](http://github.com/elasticsearch/elasticsearch-php/commit/ecd454c))
23-
- To facilitate testing and other features, the `ConnectionInterface` has expanded to obtain some more methods ([[getPath()]](http://github.com/elasticsearch/elasticsearch-php/commit/8bcf1a8), [[getUserPass()]](http://github.com/elasticsearch/elasticsearch-php/commit/586fbdb), [[getHost()]](http://github.com/elasticsearch/elasticsearch-php/commit/445fdea))
3+
- [Search Templates]: PutTemplate endpoint has been removed (see [Elasticsearch Breaking Changes](https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking_60_scripting_changes.html#_stored_search_template_apis_removed)),
4+
use PutScript instead.

src/Elasticsearch/Client.php

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,7 +1270,6 @@ public function putScript($params)
12701270
/** @var \Elasticsearch\Endpoints\Script\Put $endpoint */
12711271
$endpoint = $endpointBuilder('Script\Put');
12721272
$endpoint->setID($id)
1273-
->setLang($lang)
12741273
->setBody($body);
12751274
$endpoint->setParams($params);
12761275

@@ -1321,30 +1320,6 @@ public function deleteTemplate($params)
13211320
return $this->performRequest($endpoint);
13221321
}
13231322

1324-
/**
1325-
* $params['id'] = (string) The search template ID (Required)
1326-
*
1327-
* @param $params array Associative array of parameters
1328-
*
1329-
* @return array
1330-
*/
1331-
public function putTemplate($params)
1332-
{
1333-
$id = $this->extractArgument($params, 'id');
1334-
$body = $this->extractArgument($params, 'body');
1335-
1336-
/** @var callback $endpointBuilder */
1337-
$endpointBuilder = $this->endpoints;
1338-
1339-
/** @var \Elasticsearch\Endpoints\Template\Put $endpoint */
1340-
$endpoint = $endpointBuilder('Template\Put');
1341-
$endpoint->setID($id)
1342-
->setBody($body)
1343-
->setParams($params);
1344-
1345-
return $this->performRequest($endpoint);
1346-
}
1347-
13481323
/**
13491324
* $params['index'] = (list) A comma-separated list of indices to restrict the results
13501325
* ['fields'] = (list) A comma-separated list of fields for to get field statistics for (min value, max value, and more)

src/Elasticsearch/Endpoints/Script/Put.php

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,6 @@
1616
*/
1717
class Put extends AbstractEndpoint
1818
{
19-
/** @var String */
20-
private $lang;
21-
22-
/**
23-
* @param $lang
24-
*
25-
* @return $this
26-
*/
27-
public function setLang($lang)
28-
{
29-
if (isset($lang) !== true) {
30-
return $this;
31-
}
32-
33-
$this->lang = $lang;
34-
35-
return $this;
36-
}
37-
3819
/**
3920
* @param array $body
4021
*
@@ -57,19 +38,13 @@ public function setBody($body)
5738
*/
5839
public function getURI()
5940
{
60-
if (isset($this->lang) !== true) {
61-
throw new Exceptions\RuntimeException(
62-
'lang is required for Put'
63-
);
64-
}
6541
if (isset($this->id) !== true) {
6642
throw new Exceptions\RuntimeException(
6743
'id is required for put'
6844
);
6945
}
7046
$id = $this->id;
71-
$lang = $this->lang;
72-
$uri = "/_scripts/$lang/$id";
47+
$uri = "/_scripts/$id";
7348

7449
return $uri;
7550
}

src/Elasticsearch/Endpoints/Template/Put.php

Lines changed: 0 additions & 68 deletions
This file was deleted.

0 commit comments

Comments
 (0)