Skip to content

Commit

Permalink
Merge pull request #929 from ruflin/es-1.7.2
Browse files Browse the repository at this point in the history
Update to elasticsearch 1.7.2
  • Loading branch information
ruflin committed Sep 15, 2015
2 parents 85325e9 + 5a08b5f commit 9b6c38f
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file based on the

## [Unreleased](https://github.com/ruflin/Elastica/compare/2.2.1...HEAD)
- Lazy toArray [#916](https://github.com/ruflin/Elastica/pull/916)
- Update Elasticsearch dependency to 1.7.2 and update plugin dependencies

### Backward Compatibility Breaks
- Objects do not casts to arrays in setters and saved in params as objects. There is many side effects if you work with params on "low-level" or change your objects after you call setter with object as argument. [#916](https://github.com/ruflin/Elastica/pull/916)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Dependencies
------------
| Project | Version | Required |
|---------|---------|----------|
|[Elasticsearch](https://github.com/elasticsearch/elasticsearch/tree/v1.7.1)|1.7.1|yes|
|[Elasticsearch](https://github.com/elasticsearch/elasticsearch/tree/v1.7.2)|1.7.2|yes|
|[Elasticsearch mapper attachments plugin](https://github.com/elasticsearch/elasticsearch-mapper-attachments/tree/v2.7.0)|2.7.0|no|
|[Elasticsearch thrift transport plugin](https://github.com/elasticsearch/elasticsearch-transport-thrift/tree/v2.7.0)|2.7.0|no|
|[Elasticsearch memcached transport plugin](https://github.com/elastic/elasticsearch-transport-memcached/tree/v2.7.0)|2.7.0|no|
Expand Down
2 changes: 1 addition & 1 deletion ansible/es-playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
hosts: localhost
sudo: true
vars:
- ES_VER: "1.7.1"
- ES_VER: "1.7.2"
- ES_SHORT_VER: "1.7"
- ES_MAPPER_ATTACHMENTS_VER: "2.7.0"
- ES_TRANSPORT_MEMCACHED_VER: "2.7.0"
Expand Down
2 changes: 1 addition & 1 deletion env/elasticsearch/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM elasticsearch:1.7.1
FROM elasticsearch:1.7.2
MAINTAINER Nicolas Ruflin <spam@ruflin.com>

# Dependencies
Expand Down
2 changes: 1 addition & 1 deletion lib/Elastica/Aggregation/Filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function toArray()
// Detect between anonymous filters and named ones
$key = key($filter);

if (is_string($key)) {
if (is_string($key) && !empty($key)) {
$array['filters']['filters'][$key] = current($filter)->toArray();
} else {
$array['filters']['filters'][] = current($filter)->toArray();
Expand Down
2 changes: 1 addition & 1 deletion lib/Elastica/Transport/Http.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public function exec(Request $request, array $params)
curl_setopt($conn, CURLOPT_ENCODING, '');

// Let's precise that the request is also compressed
curl_setopt($conn, CURLOPT_HTTPHEADER, ['Content-Encoding: gzip']);
curl_setopt($conn, CURLOPT_HTTPHEADER, array('Content-Encoding: gzip'));

// Let's compress the request body,
curl_setopt($conn, CURLOPT_POSTFIELDS, gzencode($content));
Expand Down
33 changes: 33 additions & 0 deletions test/lib/Elastica/Test/ConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,37 @@ public function testGetConfigInvalidValue()
$connection = new Connection();
$connection->getConfig('url');
}

/**
* @group unit
*/
public function testCompression()
{
$connection = new Connection();

$this->assertFalse($connection->hasCompression());
$connection->setCompression(true);
$this->assertTrue($connection->hasCompression());
}

/**
* @group unit
*/
public function testCompressionDefaultWithClient()
{
$client = new \Elastica\Client();
$connection = $client->getConnection();
$this->assertFalse($connection->hasCompression());
}

/**
* @group unit
*/
public function testCompressionEnabledWithClient()
{
$client = new \Elastica\Client(array('connections' => array(array('compression' => true))));
$connection = $client->getConnection();

$this->assertTrue($connection->hasCompression());
}
}

0 comments on commit 9b6c38f

Please sign in to comment.