This is first 8.x GA release for Elastica. It contains a list of breaking changes. Have a look at the Upgrade guide.
8.0.0 is a huge milestone and a big thanks to everyone in the community that made this possible!
Backward Compatibility Breaks
- Dropped support for PHP <8.0 #2131
- Removed deprecated classes in 7.x #2132
Elastica\Exception\ElasticsearchException
-> useElastica\Exception\ResponseException::getResponse()::getFullError()
insteadElastica\Exception\ResponseException::getElasticsearchException()
-> useElastica\Exception\ResponseException::getResponse()::getFullError()
insteadElastica\Processor\Append
-> useElastica\Processor\AppendProcessor
insteadElastica\Processor\Attachment
-> useElastica\Processor\AttachmentProcessor
insteadElastica\Processor\Convert
-> useElastica\Processor\ConvertProcessor
insteadElastica\Processor\Date
-> useElastica\Processor\DateProcessor
insteadElastica\Processor\DateIndexName
-> useElastica\Processor\DateIndexNameProcessor
insteadElastica\Processor\DotExpander
-> useElastica\Processor\DotExpanderProcessor
insteadElastica\Processor\Fail
-> useElastica\Processor\FailProcessor
insteadElastica\Processor\Join
-> useElastica\Processor\JoinProcessor
insteadElastica\Processor\Json
-> useElastica\Processor\JsonProcessor
insteadElastica\Processor\Kv
-> useElastica\Processor\KvProcessor
insteadElastica\Processor\Lowercase
-> useElastica\Processor\LowercaseProcessor
insteadElastica\Processor\Remove
-> useElastica\Processor\RemoveProcessor
insteadElastica\Processor\Rename
-> useElastica\Processor\RenameProcessor
insteadElastica\Processor\Set
-> useElastica\Processor\SetProcessor
insteadElastica\Processor\Sort
-> useElastica\Processor\SortProcessor
insteadElastica\Processor\Split
-> useElastica\Processor\SplitProcessor
insteadElastica\Processor\Trim
-> useElastica\Processor\AppendProcessor
insteadElastica\Processor\Uppercase
-> useElastica\Processor\UppercaseProcessor
insteadElastica\Query\Common
-> useElastica\Query\MatchQuery
insteadElastica\QueryBuilder\DSL\Query::common_terms()
-> useElastica\QueryBuilder\DSL\Query::match()
insteadElastica\Transport\HttpAdapter
-> useElastica\Transport\Http
instead
- Removed deprecated methods #2135
Elastica\Aggregation\Range::setKeyedResponse()
-> useElastica\Aggregation\Range::setKeyed()
insteadElastica\Bulk::toString()
-> useElastica\Bulk::__toString()
or cast to string insteadElastica\Query\MatchQuery::setFieldCutoffFrequency()
Elastica\Query\MultiMatch::setCutoffFrequency()
Elastica\QueryBuilder\DSL\Aggregation::global_agg()
-> useElastica\QueryBuilder\DSL\Aggregation::global()
insteadElastica\Request::toString()
-> useElastica\Request::__toString()
or cast to string insteadElastica\Result::getType()
Elastica\Suggest\Phrase::addCandidateGenerator()
-> useElastica\Suggest\Phrase::addDirectGenerator()
insteadElastica\Util::getParamName()
- Changed following aggregation constructors #2138
Elastica\Aggregation\AvgBucket
: The second argument$bucketsPath
is now mandatoryElastica\Aggregation\BucketScript
: The second (array $bucketsPath
) and the third (string $script
) argument are now mandatoryElastica\Aggregation\BucketSelector
: The second (array $bucketsPath
) and the third (string $script
) argument are now mandatoryElastica\Aggregation\Derivative
: The second argument (string $bucketsPath
) is now mandatoryElastica\Aggregation\NormalizeAggregation
: The second (string $bucketsPath
) and the third (string $method
) argument are now mandatoryElastica\Aggregation\PercentilesBucket
: The second argument (string $bucketsPath
) is now mandatoryElastica\Aggregation\SerialDiff
: The second argument (string $bucketsPath
) is now mandatoryElastica\Aggregation\StatsBucket
: The second argument (string $bucketsPath
) is now mandatoryElastica\Aggregation\SumBucket
: The second argument (string $bucketsPath
) is now mandatory
- Changed return type of
Elastica\Cluster\Health::getActiveShardsPercentAsNumber()
method tofloat
#2144 - Changed
$origin
and$scale
parameter types ofElastica\Query\FunctionScore::addDecayFunction()
to allowfloat|int|string
#2144 - Changed
$key
parameter type ofElastica\Multi\Search::addSearch()
to allowint|string|null
#2144 - Changed
$options
parameter type ofElastica\Index::create()
to only allowarray<string, mixed>
#2147 - Changed
Elastica\Reindex::setWaitForCompletion()
to only allowbool
#2151 - Changed
Elastica\Search::addIndex()
,Elasica\Search::addIndices()
andElastica\Search::hasIndex()
parameter type to only allowElastica\Index
#2150 - Changed
$options
argument to not acceptint
in the following methods #2148Elastica\SearchableInterface::search()
Elastica\SearchableInterface::createSearch()
Elastica\Search::search()
Elastica\Search::createSearch()
Elastica\Search::setOptionsAndQuery()
Elastica\Index::search()
Elastica\Index::createSearch()
- Removed classes #2188
Elastica\Connection
Elastica\Connection\ConnectionPool
Elastica\Connection\Strategy\CallbackStrategy
Elastica\Connection\Strategy\RoundRobin
Elastica\Connection\Strategy\Simple
Elastica\Connection\Strategy\StrategyFactory
Elastica\Connection\Strategy\StrategyInterface
- Removed
Elastica\Client::setLogger()
method #2148 - Enabled
strict_types
on all classes #2190 - Changed
Elastica\Scroll:clear
to usescroll_id
body parameter instead of url parameter #2211 - Remove branch alias for dev-master from composer file #2215
Added
- Added support for PHP 8.2 #2136
- Added missing
@throws
annotations to Client::request and related methods #2152 - Added ElasticSearch 8.x to CI #2123
- Added more versions of ElasticSearch to CI #2155
- If not expicitly set, use
retry_on_conflict
from Client configuration in Bulk updates (ported from 7.x #2184) - Added support for the Combined Fields query type #2195
Changed
- Updated
php-cs-fixer
to3.13.2
#2143 - Modernize code using
match
expression #2141 - Updated docker/php/Dockerfile added AllowSymfonyFlexPlugin (false) on docker phpuser context #2194
Removed
- Removed the JSONParseException class, which is replaced by \JsonException
- Removed the JSONParseException test class
- Removed
nyholm/dsn
as no longer needed. - Removed
symfony/deprecation-contracts
as no longer needed.
Fixed
- Fix types order in
Elastica\Query
to work with psalm & expand theaggs
type to include raw arrays
New Contributors
- @sidz made their first contribution in #2131
- @pawelkeska made their first contribution in #2181
- @Jean-Beru made their first contribution in #2178
- @daminuxfork made their first contribution in #2194
- @mparker17 made their first contribution in #2196
Full Changelog: 7.3.0...8.0.0