Skip to content

Commit 9b6c38f

Browse files
committed
Merge pull request #929 from ruflin/es-1.7.2
Update to elasticsearch 1.7.2
2 parents 85325e9 + 5a08b5f commit 9b6c38f

File tree

7 files changed

+39
-5
lines changed

7 files changed

+39
-5
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file based on the
33

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

78
### Backward Compatibility Breaks
89
- 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)

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Dependencies
2323
------------
2424
| Project | Version | Required |
2525
|---------|---------|----------|
26-
|[Elasticsearch](https://github.com/elasticsearch/elasticsearch/tree/v1.7.1)|1.7.1|yes|
26+
|[Elasticsearch](https://github.com/elasticsearch/elasticsearch/tree/v1.7.2)|1.7.2|yes|
2727
|[Elasticsearch mapper attachments plugin](https://github.com/elasticsearch/elasticsearch-mapper-attachments/tree/v2.7.0)|2.7.0|no|
2828
|[Elasticsearch thrift transport plugin](https://github.com/elasticsearch/elasticsearch-transport-thrift/tree/v2.7.0)|2.7.0|no|
2929
|[Elasticsearch memcached transport plugin](https://github.com/elastic/elasticsearch-transport-memcached/tree/v2.7.0)|2.7.0|no|

ansible/es-playbook.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
hosts: localhost
66
sudo: true
77
vars:
8-
- ES_VER: "1.7.1"
8+
- ES_VER: "1.7.2"
99
- ES_SHORT_VER: "1.7"
1010
- ES_MAPPER_ATTACHMENTS_VER: "2.7.0"
1111
- ES_TRANSPORT_MEMCACHED_VER: "2.7.0"

env/elasticsearch/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM elasticsearch:1.7.1
1+
FROM elasticsearch:1.7.2
22
MAINTAINER Nicolas Ruflin <[email protected]>
33

44
# Dependencies

lib/Elastica/Aggregation/Filters.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function toArray()
4545
// Detect between anonymous filters and named ones
4646
$key = key($filter);
4747

48-
if (is_string($key)) {
48+
if (is_string($key) && !empty($key)) {
4949
$array['filters']['filters'][$key] = current($filter)->toArray();
5050
} else {
5151
$array['filters']['filters'][] = current($filter)->toArray();

lib/Elastica/Transport/Http.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public function exec(Request $request, array $params)
124124
curl_setopt($conn, CURLOPT_ENCODING, '');
125125

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

129129
// Let's compress the request body,
130130
curl_setopt($conn, CURLOPT_POSTFIELDS, gzencode($content));

test/lib/Elastica/Test/ConnectionTest.php

+33
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,37 @@ public function testGetConfigInvalidValue()
118118
$connection = new Connection();
119119
$connection->getConfig('url');
120120
}
121+
122+
/**
123+
* @group unit
124+
*/
125+
public function testCompression()
126+
{
127+
$connection = new Connection();
128+
129+
$this->assertFalse($connection->hasCompression());
130+
$connection->setCompression(true);
131+
$this->assertTrue($connection->hasCompression());
132+
}
133+
134+
/**
135+
* @group unit
136+
*/
137+
public function testCompressionDefaultWithClient()
138+
{
139+
$client = new \Elastica\Client();
140+
$connection = $client->getConnection();
141+
$this->assertFalse($connection->hasCompression());
142+
}
143+
144+
/**
145+
* @group unit
146+
*/
147+
public function testCompressionEnabledWithClient()
148+
{
149+
$client = new \Elastica\Client(array('connections' => array(array('compression' => true))));
150+
$connection = $client->getConnection();
151+
152+
$this->assertTrue($connection->hasCompression());
153+
}
121154
}

0 commit comments

Comments
 (0)