Skip to content

Commit e55698c

Browse files
committed
use elasticsearch-php ^5.0
1 parent 0eccae3 commit e55698c

File tree

5 files changed

+32
-15
lines changed

5 files changed

+32
-15
lines changed

.travis.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,29 @@ language: php
22

33
sudo: true
44

5+
addons:
6+
apt:
7+
packages:
8+
- oracle-java8-set-default
9+
510
matrix:
611
fast_finish: true
712
include:
813
- php: 5.6
914
- php: 7.0
1015
- php: 7.1
11-
env: ES_VERSION="2.4.4"
12-
- php: 7.1
13-
env: ES_VERSION="1.7.6" DOWNLOAD_URL="https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-${ES_VERSION}.deb"
1416
- php: hhvm
1517
allow_failures:
1618
- php: hhvm
1719

1820
env:
1921
global:
20-
- ES_VERSION="2.4.4"
21-
- DOWNLOAD_URL="https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/${ES_VERSION}/elasticsearch-${ES_VERSION}.deb"
22+
- ES_VERSION="5.2.2"
2223

2324
before_install:
24-
- curl -O $DOWNLOAD_URL && sudo dpkg -i --force-confnew elasticsearch-${ES_VERSION}.deb && sudo service elasticsearch restart
25+
- curl -O "https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ES_VERSION}.deb"
26+
- sudo dpkg -i --force-confnew elasticsearch-${ES_VERSION}.deb
27+
- sudo service elasticsearch restart
2528
- phpenv config-rm xdebug.ini || return 0
2629
- echo "memory_limit=2G" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini || return 0
2730

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
11
# Changelog
2+
3+
## 0.2.x
4+
5+
#### BC breaks
6+
7+
- Dropped support for Elasticsearch 1 and 2

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@ using [elastic/elasticsearch-php](https://github.com/elastic/elasticsearch-php)
1212
$ composer require broadway/read-model-elasticsearch
1313
```
1414

15+
## Version Matrix
16+
17+
| Elasticsearch Version | broadway/read-model-elasticsearch version |
18+
| --------------------- | ----------------------------------------- |
19+
| >= 5.0 | 0.2 |
20+
| >= 1.0, < 5.0 | 0.1 |
21+
22+
- If you are using Elasticsearch 5.0+ , use broadway/read-model-elasticsearch 0.2.
23+
- If you are using Elasticsearch 1.x or 2.x, use broadway/read-model-elasticsearch 0.1.
24+
25+
1526
## License
1627

1728
MIT, see LICENSE.

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"description": "Elasticsearch read model implementation using elastic/elasticsearch-php",
44
"license": "MIT",
55
"require": {
6-
"php": ">=5.5.9",
6+
"php": "^5.6|^7.0",
77
"broadway/broadway": "^1.0",
8-
"elasticsearch/elasticsearch": "^2.0"
8+
"elasticsearch/elasticsearch": "^5.0"
99
},
1010
"authors": [
1111
{
@@ -49,7 +49,7 @@
4949
},
5050
"extra": {
5151
"branch-alias": {
52-
"dev-master": "0.2.x-dev"
52+
"dev-master": "0.3.x-dev"
5353
}
5454
}
5555
}

src/ElasticSearchRepository.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,8 @@ protected function query(array $query)
180180
private function buildFindByQuery(array $fields)
181181
{
182182
return [
183-
'filtered' => [
184-
'query' => [
185-
'match_all' => new \stdClass(),
186-
],
187-
'filter' => $this->buildFilter($fields)
183+
'bool' => [
184+
'must' => $this->buildFilter($fields)
188185
]
189186
];
190187
}
@@ -219,7 +216,7 @@ private function buildFilter(array $filter)
219216
$retval[] = ['term' => [$field => $value]];
220217
}
221218

222-
return ['and' => $retval];
219+
return $retval;
223220
}
224221

225222
/**

0 commit comments

Comments
 (0)