This release is compatible with Laravel 11, 12 & 13, and with Elasticsearch 8 & 9
Added
- Elasticsearch 9 support - the full suite runs green against ES 8.18 and 9.5, and CI now tests
both on every push. No code changes were needed: the^8.17client talks to both server lines. ElasticCollection::hasQueryMeta()- whether a collection carries the meta of the query that
built it. False for the collections Eloquent builds on its own:newCollection(),hydrate(),
and anything derived throughmap(),filter()orvalues().
Fixed
cursor()returns aLazyCollection- matching Laravel's own builders, socursor()->chunk(),
->map()and->filter()work instead of fataling withCall to undefined method Generator::chunk(). Found and fixed by @BobbyBorisov in
laravel-opensearch#28cursor()crashed on a fresh connection -Processor::getRawResponse()dereferenced null when
a cursor was the first query on its connection (Call to a member function asArray() on null)paginate()lost its query meta when nothing matched - Laravel skips the query entirely once
the count comes back as zero, so an empty page arrived as a bare collection andgetQueryMeta()
on it threwMethod Illuminate\Database\Eloquent\Collection::getQueryMeta does not exist. The
count query's meta is now carried onto the empty page:getTotalHits()reports0, and it still
honourswithTrackTotalHits()for indices past the 10k window- Meta getters fataled on collections Eloquent built itself -
ElasticCollection::$metawas a
typed property that nothing initialised, sogetQueryMeta(),getTook(),getDsl()and the rest
threwTyped property ElasticCollection::$meta must not be accessed before initializationon any
collection that did not come from a query. They now fall back to an emptyQueryMeta, which
reports its unknowns as-1. Note that nullsafe could not guard this: the error came from the
property access, so$collection?->getQueryMeta()fataled too Query\Builder::get()could hand a nullMetaDTOtosetQueryMeta()- it read the
$metaTransferproperty directly instead of the accessor that initialises it
Changed
cursor()returnsLazyCollectioninstead ofGenerator.foreachis unaffected; anything
type-hintingGeneratororIteratorneeds updating- A cursor is re-iterable - a second pass opens a fresh scroll instead of throwing
Cannot rewind a generator Query\Builder::getMetaTransfer()(internal) returnsMetaDTOinstead of?MetaDTO- it
initialises on demand and never actually returned null
Laravel 11 notice: three advisories now cover the whole 11.x branch with no 11.x release that
clears them, and Composer 2.9+ blocks advisory-affected versions while resolving. On Laravel 11,
composer requireandcomposer updatewill refuse to install anything, this package included.
composer installfrom a lock file still works.composer config policy.advisories.block false
lifts it; upgrading to 12 or 13 is the real fix.
Full Changelog: v5.7.0...v5.7.1