Skip to content

Commit 861327c

Browse files
committed
Adding support to ES 5.x
This lib supports multiple versions of elasticsearch lib. However the elasticsearch lib has restricted requirements for the elastic search server. The user needs to specify the appropriated version to use in their applications based on their server
1 parent 6e94a24 commit 861327c

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

.travis.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
sudo: required
2-
dist: precise
2+
dist: trusty
33

44
language: php
55
php:
@@ -10,14 +10,18 @@ php:
1010
env:
1111
- DB=1.7.1 ES_PKG=https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.7.1.deb
1212
- DB=2.2.0 ES_PKG=https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/2.2.0/elasticsearch-2.2.0.deb
13+
- DB=5.3.2 ES_PKG=https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.3.2.deb
1314

1415
before_install:
1516
- curl -O $ES_PKG && sudo dpkg -i --force-confnew $(printf 'elasticsearch-%s.deb' $DB)
1617
- sudo service elasticsearch start
17-
- sleep 3
18+
- until curl localhost:9200; do sleep 1; done
1819

1920
install:
20-
- composer install --dev
21+
# Make sure old ES versions use the old ES lib. ES lib 5.0+ is not compatible with old ES versions
22+
- sh -c "if [ '$DB' = '1.7.1' ]; then sed -i 's/<6.0/<5.0/' composer.json; fi"
23+
- sh -c "if [ '$DB' = '2.2.0' ]; then sed -i 's/<6.0/<5.0/' composer.json; fi"
24+
- composer install
2125

2226
script: ./vendor/bin/phpunit --coverage-text
2327

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ In many cases, rebuilding an index requires a clean slate so that the entire ind
2424
composer require zumba/elasticsearch-index-rotate
2525
```
2626

27+
Elasticsearch Index Rotator supports multiple versions of ElasticSearch server and uses the [official elasticsearch](https://packagist.org/packages/elasticsearch/elasticsearch) library for execute the commands.
28+
On your application, make sure you include this package as well and specify the version supported by your Elasticsearch server. See the library documentation for the versions.
29+
2730
## Usage
2831

2932
#### Example Search

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
],
1111
"license": "MIT",
1212
"require": {
13-
"php": ">=5.4.0",
14-
"elasticsearch/elasticsearch": ">=1.0 <3.0",
13+
"php": ">=5.5.0",
14+
"elasticsearch/elasticsearch": ">=1.0 <6.0",
1515
"psr/log": "^1.0"
1616
},
1717
"autoload": {

0 commit comments

Comments
 (0)