Skip to content

Commit 79541e6

Browse files
committed
Merge branch 'master' into php7-compatibility
2 parents 3512216 + 96e87c8 commit 79541e6

File tree

5 files changed

+13
-11
lines changed

5 files changed

+13
-11
lines changed

README.markdown

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Dependencies
2222
------------
2323
| Project | Version | Required |
2424
|---------|---------|----------|
25-
|[Elasticsearch](https://github.com/elasticsearch/elasticsearch/tree/v1.5.0)|1.5.0|yes|
25+
|[Elasticsearch](https://github.com/elasticsearch/elasticsearch/tree/v1.5.2)|1.5.2|yes|
2626
|[Elasticsearch mapper attachments plugin](https://github.com/elasticsearch/elasticsearch-mapper-attachments/tree/v2.5.0)|2.5.0|no|
2727
|[Elasticsearch thrift transport plugin](https://github.com/elasticsearch/elasticsearch-transport-thrift/tree/v2.5.0)|2.5.0|no|
2828
|[Elasticsearch memcached transport plugin](https://github.com/elasticsearch/elasticsearch-transport-memcached/tree/v2.5.0)|2.5.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.5.0"
8+
- ES_VER: "1.5.2"
99
- ES_SHORT_VER: "1.5"
1010
- ES_MAPPER_ATTACHMENTS_VER: "2.5.0"
1111
- ES_TRANSPORT_MEMCACHED_VER: "2.5.0"

changes.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
CHANGES
22

33
2015-05-11
4+
- Update elasticsearch dependency to elasticsearch 1.5.2 https://www.elastic.co/downloads/past-releases/elasticsearch-1-5-2 #834
45
- Add testing on PHP 7 on Travis #826
56

67
2015-05-06
7-
- Add Elastica\Util::reindex function by scan and bulk way http://www.elastic.co/guide/en/elasticsearch/guide/master/reindex.html #829 #931
8+
- Add Elastica\Util::copy function by scan and bulk way http://www.elastic.co/guide/en/elasticsearch/guide/master/reindex.html. Note: This was first called reindex #829 #931 ##836
89

910
2015-04-23
1011
- Allow bool in Query::setSource function #818 http://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-source-filtering.html

lib/Elastica/Util.php

+5-4
Original file line numberDiff line numberDiff line change
@@ -190,13 +190,13 @@ public static function convertRequestToCurlCommand(Request $request)
190190
/**
191191
* Copy all data from and old index to a new index
192192
*
193-
* @param \Elastica\Index $newIndex
194193
* @param \Elastica\Index $oldIndex
194+
* @param \Elastica\Index $newIndex
195195
* @param string $expiryTime
196196
* @param int $sizePerShard
197-
* @return bool
197+
* @return \Elastica\Index The new index object
198198
*/
199-
public static function reindex(Index $newIndex, Index $oldIndex, $expiryTime = '1m', $sizePerShard = 1000)
199+
public static function copy(Index $oldIndex, Index $newIndex, $expiryTime = '1m', $sizePerShard = 1000)
200200
{
201201
$search = new Search($oldIndex->getClient());
202202
$bulk = new Bulk($newIndex->getClient());
@@ -217,8 +217,9 @@ public static function reindex(Index $newIndex, Index $oldIndex, $expiryTime = '
217217
$bulk->addActions($actions);
218218
$bulk->send();
219219
}
220+
220221
$newIndex->refresh();
221222

222-
return true;
223+
return $newIndex;
223224
}
224225
}

test/lib/Elastica/Test/UtilTest.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public function testConvertDateTimeObjectWithoutTimezone()
119119
$this->assertEquals($convertedString, $date);
120120
}
121121

122-
public function testReindex()
122+
public function testCopy()
123123
{
124124
$client = $this->_getClient();
125125
$oldIndex = $client->getIndex("elastica_test_reindex");
@@ -153,13 +153,13 @@ public function testReindex()
153153
$oldIndex->refresh();
154154

155155

156-
$this->assertTrue(Util::reindex($newIndex, $oldIndex ,"1m",1));
156+
$this->assertInstanceOf('Elastica\Index', Util::copy($oldIndex, $newIndex,"1m",1));
157157

158158
$newCount = $newIndex->count();
159159
$this->assertEquals(8, $newCount);
160160
}
161161

162-
public function testReindexFail()
162+
public function testCopyFail()
163163
{
164164
$client = $this->_getClient();
165165

@@ -179,7 +179,7 @@ public function testReindexFail()
179179
$newIndex2->delete();
180180

181181
try {
182-
Util::reindex($newIndex, $oldIndex);
182+
Util::copy($oldIndex, $newIndex);
183183
$this->fail('New Index should not exist');
184184
} catch (ResponseException $e) {
185185
$this->assertContains('IndexMissingException', $e->getMessage());

0 commit comments

Comments
 (0)