This is the first 8.0.0 alpha release for Elastica. It is compatible with Elasticsearch 8.0 and contains several breaking changes. We want to get this out in the wild to get as much feedback on it as we can. Any new issues found? Any migration issues? The work of getting us to GA is tracked here: #2185
Big thanks to the community for getting us to this release!
Changelog
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\AppendProcessorinsteadElastica\Processor\Attachment-> useElastica\Processor\AttachmentProcessorinsteadElastica\Processor\Convert-> useElastica\Processor\ConvertProcessorinsteadElastica\Processor\Date-> useElastica\Processor\DateProcessorinsteadElastica\Processor\DateIndexName-> useElastica\Processor\DateIndexNameProcessorinsteadElastica\Processor\DotExpander-> useElastica\Processor\DotExpanderProcessorinsteadElastica\Processor\Fail-> useElastica\Processor\FailProcessorinsteadElastica\Processor\Join-> useElastica\Processor\JoinProcessorinsteadElastica\Processor\Json-> useElastica\Processor\JsonProcessorinsteadElastica\Processor\Kv-> useElastica\Processor\KvProcessorinsteadElastica\Processor\Lowercase-> useElastica\Processor\LowercaseProcessorinsteadElastica\Processor\Remove-> useElastica\Processor\RemoveProcessorinsteadElastica\Processor\Rename-> useElastica\Processor\RenameProcessorinsteadElastica\Processor\Set-> useElastica\Processor\SetProcessorinsteadElastica\Processor\Sort-> useElastica\Processor\SortProcessorinsteadElastica\Processor\Split-> useElastica\Processor\SplitProcessorinsteadElastica\Processor\Trim-> useElastica\Processor\AppendProcessorinsteadElastica\Processor\Uppercase-> useElastica\Processor\UppercaseProcessorinsteadElastica\Query\Common-> useElastica\Query\MatchQueryinsteadElastica\QueryBuilder\DSL\Query::common_terms()-> useElastica\QueryBuilder\DSL\Query::match()insteadElastica\Transport\HttpAdapter-> useElastica\Transport\Httpinstead
- 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$bucketsPathis 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
$originand$scaleparameter types ofElastica\Query\FunctionScore::addDecayFunction()to allowfloat|int|string#2144 - Changed
$keyparameter type ofElastica\Multi\Search::addSearch()to allowint|string|null#2144 - Changed
$optionsparameter 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
$optionsargument to not acceptintin 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\ConnectionElastica\Connection\ConnectionPoolElastica\Connection\Strategy\CallbackStrategyElastica\Connection\Strategy\RoundRobinElastica\Connection\Strategy\SimpleElastica\Connection\Strategy\StrategyFactoryElastica\Connection\Strategy\StrategyInterface
- Removed
Elastica\Client::setLogger()method #2148 - Enabled
strict_typeson all classes #2190 - Changed
Elastica\Scroll:clearto usescroll_idbody parameter instead of url parameter #2211
Added
- Added support for PHP 8.2 #2136
- Added missing
@throwsannotations 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_conflictfrom Client configuration in Bulk updates (ported from 7.x #2184) - Added support for the Combined Fields query type #2195
Changed
- Updated
php-cs-fixerto3.13.2#2143 - Modernize code using
matchexpression #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/dsnas no longer needed. - Removed
symfony/deprecation-contractsas no longer needed.
Fixed
- Fix types order in
Elastica\Queryto work with psalm & expand theaggstype 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.2...8.0.0-alpha1