diff --git a/BREAKING_CHANGES.md b/BREAKING_CHANGES.md index cba9966eb..fbba874a0 100644 --- a/BREAKING_CHANGES.md +++ b/BREAKING_CHANGES.md @@ -1,23 +1,4 @@ -# 5.0 +# 6.0 -## Breaking changes - -- Indices/Analyze Endpoint: `filters` and `char_filters` URI parameters have renamed to `filter` and `char_filter` respectively -- 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)) -- 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) -- 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)) -- MoreLikeThis (MLT) endpoint has been removed -- DeleteByQuery endpoint has been removed. -- Tasks/List and Tasks/Get are now separate endpoints (see: [[e0cc5f9]](http://github.com/elasticsearch/elasticsearch-php/commit/752d5a2)) -- Client requires PHP 5.6.6 or higher - -## Deprecations - -- Percolator endpoints are deprecated and will be removed in Elasticsearch 6.0 - -## Internal BWC Breaks - -- 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)) -- Endpoints no longer use the Transport directly. If you use custom endpoints, you'll need to do some minor -refactoring (see: Refactor to remove Transport dependence in endpoints [[ecd454c]](http://github.com/elasticsearch/elasticsearch-php/commit/ecd454c)) -- 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)) +- [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)), +use PutScript instead. \ No newline at end of file diff --git a/src/Elasticsearch/Client.php b/src/Elasticsearch/Client.php index a2be325e0..e5648e745 100644 --- a/src/Elasticsearch/Client.php +++ b/src/Elasticsearch/Client.php @@ -1270,7 +1270,6 @@ public function putScript($params) /** @var \Elasticsearch\Endpoints\Script\Put $endpoint */ $endpoint = $endpointBuilder('Script\Put'); $endpoint->setID($id) - ->setLang($lang) ->setBody($body); $endpoint->setParams($params); @@ -1321,30 +1320,6 @@ public function deleteTemplate($params) return $this->performRequest($endpoint); } - /** - * $params['id'] = (string) The search template ID (Required) - * - * @param $params array Associative array of parameters - * - * @return array - */ - public function putTemplate($params) - { - $id = $this->extractArgument($params, 'id'); - $body = $this->extractArgument($params, 'body'); - - /** @var callback $endpointBuilder */ - $endpointBuilder = $this->endpoints; - - /** @var \Elasticsearch\Endpoints\Template\Put $endpoint */ - $endpoint = $endpointBuilder('Template\Put'); - $endpoint->setID($id) - ->setBody($body) - ->setParams($params); - - return $this->performRequest($endpoint); - } - /** * $params['index'] = (list) A comma-separated list of indices to restrict the results * ['fields'] = (list) A comma-separated list of fields for to get field statistics for (min value, max value, and more) diff --git a/src/Elasticsearch/Endpoints/Script/Put.php b/src/Elasticsearch/Endpoints/Script/Put.php index d10603e30..18037744e 100644 --- a/src/Elasticsearch/Endpoints/Script/Put.php +++ b/src/Elasticsearch/Endpoints/Script/Put.php @@ -16,25 +16,6 @@ */ class Put extends AbstractEndpoint { - /** @var String */ - private $lang; - - /** - * @param $lang - * - * @return $this - */ - public function setLang($lang) - { - if (isset($lang) !== true) { - return $this; - } - - $this->lang = $lang; - - return $this; - } - /** * @param array $body * @@ -57,19 +38,13 @@ public function setBody($body) */ public function getURI() { - if (isset($this->lang) !== true) { - throw new Exceptions\RuntimeException( - 'lang is required for Put' - ); - } if (isset($this->id) !== true) { throw new Exceptions\RuntimeException( 'id is required for put' ); } $id = $this->id; - $lang = $this->lang; - $uri = "/_scripts/$lang/$id"; + $uri = "/_scripts/$id"; return $uri; } diff --git a/src/Elasticsearch/Endpoints/Template/Put.php b/src/Elasticsearch/Endpoints/Template/Put.php deleted file mode 100644 index 075f41335..000000000 --- a/src/Elasticsearch/Endpoints/Template/Put.php +++ /dev/null @@ -1,68 +0,0 @@ - - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 - * @link http://elastic.co - */ -class Put extends AbstractEndpoint -{ - /** - * @param array $body - * - * @return $this - */ - public function setBody($body) - { - if (isset($body) !== true) { - return $this; - } - - $this->body = $body; - - return $this; - } - - /** - * @throws \Elasticsearch\Common\Exceptions\RuntimeException - * @return string - */ - public function getURI() - { - if (isset($this->id) !== true) { - throw new Exceptions\RuntimeException( - 'id is required for Put' - ); - } - - $templateId = $this->id; - $uri = "/_search/template/$templateId"; - - return $uri; - } - - /** - * @return string[] - */ - public function getParamWhitelist() - { - return array(); - } - - /** - * @return string - */ - public function getMethod() - { - return 'PUT'; - } -}