Skip to content

Commit

Permalink
Prepare release-5.2.0 (#1286)
Browse files Browse the repository at this point in the history
* Update liniting
  • Loading branch information
ruflin authored Apr 13, 2017
1 parent 8b45039 commit 5244a6c
Show file tree
Hide file tree
Showing 15 changed files with 30 additions and 19 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.1.0...master)
## [Unreleased](https://github.com/ruflin/Elastica/compare/5.2.0...master)

### Backward Compatibility Breaks

### Bugfixes

### Added

### Improvements

### Deprecated


## [Unreleased](https://github.com/ruflin/Elastica/compare/5.1.0...5.2.0)

### Bugfixes

- Fix reading bool index settings like `\Elastica\Index\Settings::getBlocksWrite`. Elasticsearch returns all settings as strings and does not normalize bool values.
The getters now return the right bool value for whichever string representation is used like 'true', '1', 'on', 'yes'. [#1251](https://github.com/ruflin/Elastica/pull/1251)
- Fix for QueryBuilder version check `\Elastica\QueryBuilder\Version\Version240.php` added all new query types to queries array. [#1266](https://github.com/ruflin/Elastica/pull/1266) [#1269](https://github.com/ruflin/Elastica/pull/1269)
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "5.1.x-dev"
"dev-master": "5.2.x-dev"
}
}
}
3 changes: 2 additions & 1 deletion lib/Elastica/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -690,9 +690,10 @@ public function request($path, $method = Request::GET, $data = [], array $query
}

/**
* Makes calls to the elasticsearch server with usage official client Endpoint
* Makes calls to the elasticsearch server with usage official client Endpoint.
*
* @param AbstractEndpoint $endpoint
*
* @return Response
*/
public function requestEndpoint(AbstractEndpoint $endpoint)
Expand Down
1 change: 0 additions & 1 deletion lib/Elastica/Cluster/Health.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

use Elastica\Client;
use Elastica\Cluster\Health\Index;
use Elastica\Request;

/**
* Elastic cluster health.
Expand Down
5 changes: 4 additions & 1 deletion lib/Elastica/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ public function setSettings(array $data)
{
$endpoint = new Put();
$endpoint->setBody($data);

return $this->requestEndpoint($endpoint);
}

Expand All @@ -547,15 +548,17 @@ public function request($path, $method, $data = [], array $query = [])
}

/**
* Makes calls to the elasticsearch server with usage official client Endpoint based on this index
* Makes calls to the elasticsearch server with usage official client Endpoint based on this index.
*
* @param AbstractEndpoint $endpoint
*
* @return Response
*/
public function requestEndpoint(AbstractEndpoint $endpoint)
{
$cloned = clone $endpoint;
$cloned->setIndex($this->getName());

return $this->getClient()->requestEndpoint($cloned);
}

Expand Down
1 change: 0 additions & 1 deletion lib/Elastica/Index/Stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
namespace Elastica\Index;

use Elastica\Index as BaseIndex;
use Elastica\Request;

/**
* Elastica index stats object.
Expand Down
1 change: 0 additions & 1 deletion lib/Elastica/Node/Info.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
namespace Elastica\Node;

use Elastica\Node as BaseNode;
use Elastica\Request;

/**
* Elastica cluster node object.
Expand Down
1 change: 0 additions & 1 deletion lib/Elastica/Node/Stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
namespace Elastica\Node;

use Elastica\Node as BaseNode;
use Elastica\Request;

/**
* Elastica cluster node object.
Expand Down
1 change: 0 additions & 1 deletion lib/Elastica/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

use Elastica\Aggregation\AbstractAggregation;
use Elastica\Exception\InvalidException;
use Elastica\Exception\NotImplementedException;
use Elastica\Query\AbstractQuery;
use Elastica\Query\MatchAll;
use Elastica\Query\QueryString;
Expand Down
4 changes: 2 additions & 2 deletions lib/Elastica/Scroll.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Scroll implements \Iterator

/**
* 0: scroll<br>
* 1: scroll id
* 1: scroll id.
*
* @var array
*/
Expand Down Expand Up @@ -142,7 +142,7 @@ public function rewind()
protected function _setScrollId(ResultSet $resultSet)
{
$this->_currentResultSet = $resultSet;
$this->currentPage++;
++$this->currentPage;
$this->totalPages = $resultSet->count() > 0 ? ceil($resultSet->getTotalHits() / $resultSet->count()) : 0;
$this->_nextScrollId = $resultSet->getResponse()->isOk() ? $resultSet->getResponse()->getScrollId() : null;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Elastica/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ protected function _validateOption($key)
case self::OPTION_SEARCH_IGNORE_UNAVAILABLE:
case self::OPTION_QUERY_CACHE:
case self::OPTION_TERMINATE_AFTER:
case self::OPTION_SHARD_REQUEST_CACHE:
case self::OPTION_SHARD_REQUEST_CACHE:
return true;
}

Expand Down
4 changes: 3 additions & 1 deletion lib/Elastica/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -508,15 +508,17 @@ public function request($path, $method, $data = [], array $query = [])
}

/**
* Makes calls to the elasticsearch server with usage official client Endpoint based on this type
* Makes calls to the elasticsearch server with usage official client Endpoint based on this type.
*
* @param AbstractEndpoint $endpoint
*
* @return Response
*/
public function requestEndpoint(AbstractEndpoint $endpoint)
{
$cloned = clone $endpoint;
$cloned->setType($this->getName());

return $this->getIndex()->requestEndpoint($cloned);
}

Expand Down
1 change: 0 additions & 1 deletion lib/Elastica/Type/Mapping.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
namespace Elastica\Type;

use Elastica\Exception\InvalidException;
use Elastica\Request;
use Elastica\Type;
use Elasticsearch\Endpoints\Indices\Mapping\Put;

Expand Down
4 changes: 2 additions & 2 deletions test/Elastica/IndexTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -923,8 +923,8 @@ public function testRequestEndpoint()
$index = $this->_createIndex();
$index->refresh();
$endpoint = new Analyze();
$endpoint->setIndex("fooIndex");
$endpoint->setBody("foo");
$endpoint->setIndex('fooIndex');
$endpoint->setBody('foo');
$returnedTokens = $index->requestEndpoint($endpoint)->getData()['tokens'];

$tokens = [
Expand Down
6 changes: 3 additions & 3 deletions test/Elastica/TypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -970,16 +970,16 @@ public function testGetMappingAlias()
public function testRequestEndpoint()
{
$index = $this->_createIndex();
$type = new Type($index, "foo");
$type = new Type($index, 'foo');

$mapping = new Mapping($type, $expect = [
'id' => ['type' => 'integer', 'store' => true],
]);
$type->setMapping($mapping);

$endpoint = new Get();
$endpoint->setIndex("nonExistsIndex");
$endpoint->setType("nonExistsType");
$endpoint->setIndex('nonExistsIndex');
$endpoint->setType('nonExistsType');

$response = $type->requestEndpoint($endpoint);
$data = $response->getData();
Expand Down

0 comments on commit 5244a6c

Please sign in to comment.