diff --git a/CHANGELOG.md b/CHANGELOG.md index bea07c7b94..5d93f2683e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,23 @@ # Change Log All notable changes to this project will be documented in this file based on the [Keep a Changelog](http://keepachangelog.com/) Standard. This project adheres to [Semantic Versioning](http://semver.org/). -## [Unreleased](https://github.com/ruflin/Elastica/compare/5.2.0...master) +## [Unreleased](https://github.com/ruflin/Elastica/compare/5.2.1...master) ### Backward Compatibility Breaks ### Bugfixes +### Added + +### Improvements + +### Deprecated + + +## [5.2.1](https://github.com/ruflin/Elastica/compare/5.2.0...5.2.1) + +### Bugfixes + - Fix elastic 5.3.x deprecation warning related to Content-Type not being set. - Fix updating settings of an index. [#1296](https://github.com/ruflin/Elastica/pull/1296) - Fix bad parameter value to refresh document [#1318](https://github.com/rufli/Elastica/pull/1318) @@ -15,7 +26,7 @@ All notable changes to this project will be documented in this file based on the - Parameter `filter_path` for response filtering (e.g. `$index->search($query, ['filter_path' => 'hits.hits._source'])`) - Add support for Health parameters for Cluster\Health endpoint (new prop : delayed_unassigned_shards, number_of_pending_tasks, number_of_in_flight_fetch, task_max_waiting_in_queue_millis, active_shards_percent_as_number) - - Add support for querystring in Type. this allow to use `update_all_types` in type mapping in order to resolve conflicts between fields in different types. [Conflicts between fields in different types](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html#merging-conflicts) + - Add support for querystring in Type. this allow to use `update_all_types` in type mapping in order to resolve conflicts between fields in different types. [Conflicts between fields in different types](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html#merging-conflicts) - Added `\Elastica\Query\ParentId` to avoid join with parent documents [#1287](https://github.com/ruflin/Elastica/issues/1287) - Added `\Elastica\Reindex` for reindexing between indices [#1311](https://github.com/ruflin/Elastica/issues/1311) @@ -26,7 +37,7 @@ All notable changes to this project will be documented in this file based on the ### Deprecated - Deprecated `Tool\CrossIndex` use `\Elastica\Reindex` instead [#1311](https://github.com/ruflin/Elastica/issues/1311) -## [Unreleased](https://github.com/ruflin/Elastica/compare/5.1.0...5.2.0) +## [5.2.0](https://github.com/ruflin/Elastica/compare/5.1.0...5.2.0) ### Bugfixes diff --git a/lib/Elastica/Client.php b/lib/Elastica/Client.php index f2af8f6f9a..25cd474c65 100644 --- a/lib/Elastica/Client.php +++ b/lib/Elastica/Client.php @@ -654,10 +654,10 @@ public function bulk(array $params) * * It's possible to make any REST query directly over this method * - * @param string $path Path to call - * @param string $method Rest method to use (GET, POST, DELETE, PUT) - * @param array|string $data OPTIONAL Arguments as array or pre-encoded string - * @param array $query OPTIONAL Query params + * @param string $path Path to call + * @param string $method Rest method to use (GET, POST, DELETE, PUT) + * @param array|string $data OPTIONAL Arguments as array or pre-encoded string + * @param array $query OPTIONAL Query params * @param string $contentType Content-Type sent with this request * * @throws Exception\ConnectionException|\Exception diff --git a/lib/Elastica/Cluster/Health.php b/lib/Elastica/Cluster/Health.php index f743dc5123..e247021c37 100644 --- a/lib/Elastica/Cluster/Health.php +++ b/lib/Elastica/Cluster/Health.php @@ -170,7 +170,7 @@ public function getUnassignedShards() } /** - * get the number of delayed unassined shards + * get the number of delayed unassined shards. * * @return int */ diff --git a/lib/Elastica/Index.php b/lib/Elastica/Index.php index 2890637c62..65d62b9596 100644 --- a/lib/Elastica/Index.php +++ b/lib/Elastica/Index.php @@ -7,7 +7,6 @@ use Elastica\Index\Stats as IndexStats; use Elastica\ResultSet\BuilderInterface; use Elasticsearch\Endpoints\AbstractEndpoint; -use Elasticsearch\Endpoints\Indices\Settings\Put; use Elasticsearch\Endpoints\DeleteByQuery; use Elasticsearch\Endpoints\Indices\Aliases\Update; use Elasticsearch\Endpoints\Indices\Analyze; @@ -21,6 +20,7 @@ use Elasticsearch\Endpoints\Indices\Mapping\Get; use Elasticsearch\Endpoints\Indices\Open; use Elasticsearch\Endpoints\Indices\Refresh; +use Elasticsearch\Endpoints\Indices\Settings\Put; /** * Elastica index object. diff --git a/lib/Elastica/Multi/Search.php b/lib/Elastica/Multi/Search.php index 1939e4856c..424ba9a97d 100644 --- a/lib/Elastica/Multi/Search.php +++ b/lib/Elastica/Multi/Search.php @@ -146,7 +146,7 @@ public function search() Request::POST, $data, $this->_options, - Request::NDJSON_CONTENT_TYPE + Request::NDJSON_CONTENT_TYPE ); return $this->_builder->buildMultiResultSet($response, $this->getSearches()); diff --git a/lib/Elastica/Reindex.php b/lib/Elastica/Reindex.php index 49ed31698e..de1f625350 100644 --- a/lib/Elastica/Reindex.php +++ b/lib/Elastica/Reindex.php @@ -55,7 +55,7 @@ protected function _getBody($oldIndex, $newIndex, $options) { $body = array_merge([ 'source' => $this->_getSourcePartBody($oldIndex, $options), - 'dest' => $this->_getDestPartBody($newIndex, $options) + 'dest' => $this->_getDestPartBody($newIndex, $options), ], $this->_resolveBodyOptions($options)); return $body; @@ -114,6 +114,7 @@ private function _setSourceQuery(array $sourceBody) if (isset($sourceBody[self::QUERY]) && $sourceBody[self::QUERY] instanceof AbstractQuery) { $sourceBody[self::QUERY] = $sourceBody[self::QUERY]->toArray(); } + return $sourceBody; } @@ -132,8 +133,9 @@ private function _setSourceType(array $sourceBody) if ($type instanceof Type) { $sourceBody[self::TYPE][$key] = $type->getName(); } - } + } } + return $sourceBody; } } diff --git a/lib/Elastica/Request.php b/lib/Elastica/Request.php index d81702ea35..9f55e52cec 100644 --- a/lib/Elastica/Request.php +++ b/lib/Elastica/Request.php @@ -26,16 +26,16 @@ class Request extends Param /** * Construct. * - * @param string $path Request path - * @param string $method OPTIONAL Request method (use const's) (default = self::GET) - * @param array $data OPTIONAL Data array - * @param array $query OPTIONAL Query params + * @param string $path Request path + * @param string $method OPTIONAL Request method (use const's) (default = self::GET) + * @param array $data OPTIONAL Data array + * @param array $query OPTIONAL Query params * @param Connection $connection * @param string $contentType Content-Type sent with this request * * @return \Elastica\Request OPTIONAL Connection object */ - public function __construct($path, $method = self::GET, $data = [], array $query = [], Connection $connection = null, $contentType = self::DEFAULT_CONTENT_TYPE ) + public function __construct($path, $method = self::GET, $data = [], array $query = [], Connection $connection = null, $contentType = self::DEFAULT_CONTENT_TYPE) { $this->setPath($path); $this->setMethod($method); @@ -163,7 +163,8 @@ public function getConnection() } /** - * Set the Content-Type of this request + * Set the Content-Type of this request. + * * @param string $contentType */ public function setContentType($contentType) @@ -172,7 +173,7 @@ public function setContentType($contentType) } /** - * Get the Content-Type of this request + * Get the Content-Type of this request. */ public function getContentType() { diff --git a/lib/Elastica/Type.php b/lib/Elastica/Type.php index 6097592012..4529473136 100644 --- a/lib/Elastica/Type.php +++ b/lib/Elastica/Type.php @@ -292,7 +292,7 @@ public function getName() * Sets value type mapping for this type. * * @param \Elastica\Type\Mapping|array $mapping Elastica\Type\MappingType object or property array with all mappings - * @param array $query querystring when put mapping (for example update_all_types) + * @param array $query querystring when put mapping (for example update_all_types) * * @return \Elastica\Response */ diff --git a/test/Elastica/Cluster/HealthTest.php b/test/Elastica/Cluster/HealthTest.php index 3b7f8faede..438b90d3e7 100644 --- a/test/Elastica/Cluster/HealthTest.php +++ b/test/Elastica/Cluster/HealthTest.php @@ -29,7 +29,7 @@ protected function setUp() 'unassigned_shards' => 5, 'delayed_unassigned_shards' => 4, 'number_of_pending_tasks' => 1, - 'number_of_in_flight_fetch' => 2, + 'number_of_in_flight_fetch' => 2, 'task_max_waiting_in_queue_millis' => 634, 'active_shards_percent_as_number' => 50.0, diff --git a/test/Elastica/SnapshotTest.php b/test/Elastica/SnapshotTest.php index c3a78cbafb..affbce8f61 100644 --- a/test/Elastica/SnapshotTest.php +++ b/test/Elastica/SnapshotTest.php @@ -48,7 +48,6 @@ public function testRegisterRepository() $repositoryName = 'testrepo'; $location = $this->_snapshotPath.'backup1'; - $response = $this->_snapshot->registerRepository($repositoryName, 'fs', ['location' => $location]); $this->assertTrue($response->isOk()); diff --git a/test/Elastica/TypeTest.php b/test/Elastica/TypeTest.php index 3bcb1d6ee5..a1eb84d1d7 100644 --- a/test/Elastica/TypeTest.php +++ b/test/Elastica/TypeTest.php @@ -1016,7 +1016,6 @@ public function testExceptionMappingOnFieldsWithSameName() /** * @group functional - * */ public function testMappingOnFieldsWithSameName() {