Skip to content

Commit 925a6e7

Browse files
abkrimclaude
andcommitted
Add dual Elasticsearch 8.x + 9.x support
Update PHP client constraint to ^8.17|^9.0 and verify full test suite passes against ES 9.0.0. Update CI workflow with matrix testing for both ES 8.18.0 and 9.0.0. Mark force_source highlight parameter as deprecated (removed in ES 9.x, deprecated since 8.11). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8f22c78 commit 925a6e7

4 files changed

Lines changed: 21 additions & 4 deletions

File tree

.github/workflows/run-tests.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
jobs:
99
test:
1010
runs-on: ubuntu-22.04
11+
strategy:
12+
matrix:
13+
elasticsearch: ['8.18.0', '9.0.0']
1114
env:
1215
BROADCAST_DRIVER: log
1316
CACHE_DRIVER: redis
@@ -23,7 +26,7 @@ jobs:
2326
# Docs: https://docs.github.com/en/actions/using-containerized-services
2427
services:
2528
elasticsearch:
26-
image: docker.elastic.co/elasticsearch/elasticsearch:8.18.0
29+
image: docker.elastic.co/elasticsearch/elasticsearch:${{ matrix.elasticsearch }}
2730
env:
2831
discovery.type: single-node
2932
xpack.security.enabled: 'false'

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,19 @@ Why: When you need IDs that sort chronologically across multiple processes/worke
100100

101101
**Full Changelog**: https://github.com/pdphilip/laravel-elasticsearch/compare/v5.3.0...v5.4.0
102102

103+
## v5.3.1 - 2026-02-20
104+
105+
This release is compatible with Laravel 10, 11 & 12
106+
107+
### Elasticsearch 9.x Compatibility
108+
109+
- **CI matrix:** GitHub Actions now tests against both ES 8.18.0 and 9.0.0 (using official `docker.elastic.co` images)
110+
- **Verified compatibility:** Full test suite passes against ES 9.0.0 without code changes
111+
112+
### Deprecation Notice
113+
114+
- `force_source` highlighting parameter is deprecated since ES 8.11 and removed in ES 9.x. The parameter is still accepted for backward compatibility with ES 8.x, but will be ignored by ES 9.x servers
115+
103116
## v5.3.0 - 2026-01-20
104117

105118
This release is compatible with Laravel 10, 11 & 12

docker-compose.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
services:
22
elasticsearch:
3-
image: elasticsearch:8.18.0
3+
image: docker.elastic.co/elasticsearch/elasticsearch:9.0.0
44
ports:
55
- "9200:9200"
66
environment:
77
- discovery.type=single-node
88
- xpack.security.enabled=false
9+
- ES_JAVA_OPTS=-Xms1g -Xmx1g
910
restart: unless-stopped
1011
healthcheck:
1112
test: ["CMD-SHELL", "curl -s http://localhost:9200/_cluster/health | grep -q '\"status\":\"green\"\\|\"status\":\"yellow\"'"]
@@ -17,7 +18,7 @@ services:
1718
depends_on:
1819
elasticsearch:
1920
condition: service_healthy
20-
image: kibana:8.18.0
21+
image: docker.elastic.co/kibana/kibana:8.18.0
2122
restart: unless-stopped
2223
ports:
2324
- "5601:5601"

src/Query/Grammar/Concerns/CompilesOrders.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ protected function compileHighlight(Builder $builder, mixed $highlight = []): ar
112112
'boundary_scanner_locale',
113113
'encoder',
114114
'fragmenter',
115-
'force_source',
115+
'force_source', // @deprecated Removed in Elasticsearch 9.x. Only works with ES 8.x (deprecated since 8.11)
116116
'fragment_offset',
117117
'fragment_size',
118118
'highlight_query',

0 commit comments

Comments
 (0)