Breaking changes from 6.x

edit

Breaking changes from 6.x

edit

E_USER_DEPRECATED notice when using deprecated parameters

edit

Starting from elasticsearch-php 7.4.0, we generate a PHP E_USER_DEPRECATED notice every time you use a deprecated parameters for Elasticsearch. We decided to add this notice to facilitate the code refactoring with the new API specification of Elasticsearch (for example the usage of typeless APIs, see below).

From 7.4.1, we mitigated the usage of E_USER_DEPRICATED warning by using the @ operator. The operator suppresses the error message, however, it is still possible to catch it by using a custom error handler:

set_error_handler(function ($errno, $errstr) {
    var_dump($errstr);
}, E_USER_DEPRECATED);

@trigger_error('Deprecation message here', E_USER_DEPRECATED);

Moving from types to typeless APIs in Elasticsearch 7.0

edit

Elasticsearch 7.0 deprecated APIs that accept types, introduced new typeless APIs, and removed support for the default mapping. Read this blog post for more information.

Type hint and return type

edit

Added type hints and return type declarations in all the code base where possible. See PR #897.

PHP 7.1+ Requirement

edit

We require using PHP 7.1+ for elasticsearch-php. PHP 7.0 is not supported since 1st Jan 2019. Refer PHP supported version for more information.