Loading

Elasticsearch PHP Client release notes

Review the changes, fixes, and more in each version of Elasticsearch PHP Client.

To check for security updates, go to Security announcements for the Elastic stack.

  • Added the ES|QL query builder #1462

This query builder should simplify the usage of the Elasticsearch Query Language (ES|QL) in PHP.

Example usage:

$query = Esql\Query::from("books", "books*")
    ->where('author == "King"', 'year == 1982')
    ->limit(10);
echo $query;
		

Output:

FROM books, books*
| WHERE author == "King" AND year == 1982
| LIMIT 10
		

This release includes the following endpoint changes for Elasticsearch 9.2.0:

  • Added the project_routing parameter (string), a Lucene query using project metadata tags to limit which projects to search, such as _alias:_origin or _alias:pr. Only supported in serverless.
  • Added the bytes parameter (string), the unit in which to display byte values
  • Added the time parameter (string), the unit in which to display time values
  • Added the bytes parameter (string), the unit in which to display byte values
  • Added the time parameter (string), the unit in which to display time values
  • Added the project_routing parameter (string), a Lucene query using project metadata tags to limit which projects to search, such as _alias:_origin or _alias:pr. Only supported in serverless.
  • Added the bytes parameter (string), the unit in which to display byte values
  • Added the time parameter (string), the unit in which to display time values
  • Added the time parameter (string), the unit in which to display time values
  • Added the bytes parameter (string), the unit in which to display byte values
  • Added the bytes parameter (string), the unit in which to display byte values
  • Added the time parameter (string), the unit in which to display time values
  • Added the bytes parameter (string), the unit in which to display byte values
  • Added the bytes parameter (string), the unit in which to display byte values
  • Added the time parameter (string), the unit in which to display time values
  • Added the bytes parameter (string), the unit in which to display byte values
  • Added the bytes parameter (string), the unit in which to display byte values
  • Added the time parameter (string), the unit in which to display time values
  • Added the bytes parameter (string), the unit in which to display byte values
  • Added the time parameter (string), the unit in which to display time values
  • Added the time parameter (string), the unit in which to display time values
  • Added the ignore_unavailable parameter (bool), whether specified concrete indices should be ignored when unavailable (missing or closed). Only allowed when providing an index expression.
  • Added the ignore_throttled (bool), whether specified concrete, expanded or aliased indices should be ignored when throttled. Only allowed when providing an index expression.
  • Added the allow_no_indices (bool), whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified). Only allowed when providing an index expression.
  • Added the expand_wildcards parameter (string), whether to expand wildcard expression to concrete indices that are open, closed or both.
  • Added the allow_closed parameter (bool), if true, allow closed indices to be returned in the response otherwise if false, keep the legacy behaviour of throwing an exception if index pattern matches closed indices
  • Added the bytes paremeter (string), the unit in which to display byte values
  • Added the bytes paremeter (string), the unit in which to display byte values
  • Added the bytes parameter (string), the unit in which to display byte values
  • Added the time parameter (string), the unit in which to display time values
  • Added the bytes parameter (string), the unit in which to display byte values
  • Added the bytes parameter (string), the unit in which to display byte values
  • Added the index parameter (string), specifies the name of the index that you would like an explanation for
  • Added the shard paremeter (int), specifies the ID of the shard that you would like an explanation for
  • Added the primary parameter (bool), if true, returns explanation for the primary shard for the given shard ID
  • Added the current_node parameter (string), specifies the node ID or the name of the node to only explain a shard that is currently located on the specified node

This experimental endpoint has been removed.

  • Added the project_routing parameter (string), a Lucene query using project metadata tags to limit which projects to search, such as _alias:_origin or _alias:pr. Only supported in serverless.
  • API: http://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/indices.cancel_migrate_reindex.json
  • Documentation: http://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-cancel-migrate-reindex
  • API: http://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/indices.create_from.json
  • Documentation: http://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-create-from
  • API: http://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_data_stream_mappings.json
  • Documentation: http://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-data-stream-mappings
  • API: http://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_migrate_reindex_status.json
  • Documentation: http://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-migration
  • API: http://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/indices.migrate_reindex.json
  • Documentation: http://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-migrate-reindex
  • API: http://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_data_stream_mappings.json
  • Documentation: http://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-data-stream-mappings
  • Added timeout parameter (int|string), specifies the amount of time to wait for the inference request to complete.
  • Added timeout parameter (int|string), specifies the amount of time to wait for the inference request to complete.
  • Added timeout parameter (int|string), specifies the amount of time to wait for the inference request to complete.
  • Added timeout parameter (int|string), specifies the amount of time to wait for the inference request to complete.
  • API: http://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/inference.put_ai21.json
  • Documentation: http://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-ai21
  • Added timeout parameter (int|string), specifies the amount of time to wait for the inference request to complete.
  • Added timeout parameter (int|string), specifies the amount of time to wait for the inference request to complete.
  • Added timeout parameter (int|string), specifies the amount of time to wait for the inference request to complete.
  • Added timeout parameter (int|string), specifies the amount of time to wait for the inference request to complete.
  • Added timeout parameter (int|string), specifies the amount of time to wait for the inference request to complete.
  • Added timeout parameter (int|string), specifies the amount of time to wait for the inference request to complete.
  • API: http://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/inference.put_contextualai.json
  • Documentation: http://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-contextualai
  • Added timeout parameter (int|string), specifies the amount of time to wait for the inference request to complete.
  • Added timeout parameter (int|string), specifies the amount of time to wait for the inference request to complete.
  • Added timeout parameter (int|string), specifies the amount of time to wait for the inference request to complete.
  • Added timeout parameter (int|string), specifies the amount of time to wait for the inference request to complete.
  • Added timeout parameter (int|string), specifies the amount of time to wait for the inference request to complete.
  • Added timeout parameter (int|string), specifies the amount of time to wait for the inference request to complete.
  • Added timeout parameter (int|string), specifies the amount of time to wait for the inference request to complete.
  • API: http://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/inference.put_llama.json
  • Documentation: http://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-llama
  • Added timeout parameter (int|string), specifies the amount of time to wait for the inference request to complete.
  • Added timeout parameter (int|string), specifies the amount of time to wait for the inference request to complete.
  • Added timeout parameter (int|string), specifies the amount of time to wait for the inference request to complete.
  • Added timeout parameter (int|string), specifies the amount of time to wait for the inference request to complete.
  • Added timeout parameter (int|string), specifies the amount of time to wait for the inference request to complete.
  • Added timeout parameter (int|string), specifies the amount of time to wait for the inference request to complete.
  • Added timeout parameter (int|string), specifies the amount of time to wait for the inference request to complete.
  • Added timeout parameter (int|string), specifies the amount of time to wait for the inference request to complete.
  • API: http://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/project.tags.json
  • Documentation: http://www.elastic.co/docs/api/doc/elasticsearch-serverless/operation/operation-project-tags
  • API: http://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/security.get_stats.json
  • Documentation: http://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-stats
  • Added the merge_type parameter (string), the mapping merge type if mapping overrides are being provided in mapping_addition.The allowed values are one of index or template.The index option merges mappings the way they would be merged into an existing index.The template option merges mappings the way they would be merged into a template.
  • Added the project_routing parameter (string), a Lucene query using project metadata tags to limit which projects to search, such as _alias:_origin or _alias:pr. Only supported in serverless.
  • API: http://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/transform.set_upgrade_mode.json
  • Documentation: http://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-set-upgrade-mode

This release includes the following endpoint changes for Elasticsearch 9.1.0:

  • Added flat_settings parameter (bool), return settings in flat format (default: false)
  • Added settings_filter parameter (string), filter out results, for example to filter out sensitive information. Supports wildcards or full settings keys
  • Removed timeout parameter
  • Added cause parameter (string), user defined reason for create the component template
  • Added ccs_minimize_roundtrips parameter (bool), indicates whether network round-trips should be minimized as part of cross-cluster search requests execution
  • Added ignore_unavailable parameter (bool), whether specified concrete indices should be ignored when unavailable (missing or closed)
  • Added allow_no_indices parameter (bool), whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)
  • Added expand_wildcards parameter (string), whether to expand wildcard expression to concrete indices that are open, closed or both.
  • Added allow_partial_results parameter (bool), if true, partial results will be returned if there are shard failures, but the query can continue to execute on other clusters and shards. If false, the entire query will fail if there are any failures.
  • Added format parameter (string), a short version of the Accept header, e.g. json, yaml
  • Documentation: http://www.elastic.co/docs/api/doc/elasticsearch-serverless/operation/operation-esql-get-query
  • Documentation: http://www.elastic.co/docs/api/doc/elasticsearch-serverless/operation/operation-esql-list-queries
  • Added allow_partial_results parameter (bool), if true, partial results will be returned if there are shard failures, but the query can continue to execute on other clusters and shards. If false, the entire query will fail if there are any failures.
  • Documentation: http://www.elastic.co/guide/en/elasticsearch/reference/current/index.html
  • API: http://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/indices.delete_data_stream_options.json
  • Docuemntation: http://www.elastic.co/docs/api/doc/elasticsearch-serverless/operation/operation-indices-get-data-stream-options
  • Documentation: http://www.elastic.co/docs/api/doc/elasticsearch-serverless/operation/operation-indices-get-data-stream-settings
  • Removed the local parameter.
  • Documentation: http://www.elastic.co/docs/api/doc/elasticsearch-serverless/operation/operation-indices-put-data-stream-options
  • Documentation: http://www.elastic.co/docs/api/doc/elasticsearch-serverless/operation/operation-indices-put-data-stream-settings
  • Added ignore_unavailable parameter (bool), whether specified concrete indices should be ignored when unavailable (missing or closed)
  • Added allow_no_indices parameter (bool), whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)
  • Added expand_wildcards parameter (string), whether to expand wildcard expression to concrete indices that are open, closed or both.
  • Documentation: http://www.elastic.co/docs/api/doc/elasticsearch-serverless/operation/operation-indices-remove-block
  • Documentation: http://www.elastic.co/docs/api/doc/elasticsearch-serverless/operation/operation-inference-put-amazonsagemaker
  • Documentation: http://www.elastic.co/docs/api/doc/elasticsearch-serverless/operation/operation-inference-put-custom
  • Documentation: http://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-deepseek
  • Added state parameter (string|array<string>), filter snapshots by a comma-separated list of states. Valid state values are 'SUCCESS', 'IN_PROGRESS', 'FAILED', 'PARTIAL', or 'INCOMPATIBLE'.
  • Added register_operation_count parameter (int), the minimum number of linearizable register operations to perform in total. Defaults to 10.
  • Documentation: http://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-verify-repository
  • Documentation: http://www.elastic.co/guide/en/elasticsearch/reference/master/streams-logs-disable.html
  • API: http://www.elastic.co/guide/en/elasticsearch/reference/master/streams-logs-disable.html
  • Documentation: http://www.elastic.co/guide/en/elasticsearch/reference/master/streams-logs-enable.html
  • API: http://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/streams.logs_enable.json
  • Documentation: http://www.elastic.co/guide/en/elasticsearch/reference/master/streams-status.html
  • API: http://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/main/resources/rest-api-spec/api/streams.status.json
  • Added refresh parameter (bool), refresh search analyzers to update synonyms
  • Added refresh parameter (bool), refresh search analyzers to update synonyms
  • Added refresh parameter (bool), refresh search analyzers to update synonyms
  • Added require_alias parameter (bool), when true, requires destination to be an alias. Default is false
  • Added require_data_stream parameter (bool), when true, requires destination to be a data stream (existing or to be created). Default is false
  • Added ignore_unavailable parameter (bool), whether specified concrete indices should be ignored when unavailable (missing or closed)
  • Added ignore_throttled parameter (bool), whether specified concrete, expanded or aliased indices should be ignored when throttled
  • Added allow_no_indices parameter (bool), whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)
  • Added expand_wildcards parameter (string), whether to expand wildcard expression to concrete indices that are open, closed or both.
  • Added routing parameter (string|array<string>), a comma-separated list of specific routing values
  • Added include_named_queries_score parameter (bool), indicates whether hit.matched_queries should be rendered as a map that includes the name of the matched query associated with its score (true) or as an array containing the name of the matched queries (false)
  • Added max_concurrent_shard_requests parameter (int), the number of concurrent shard requests per node executed concurrently when opening this point-in-time. This value should be used to limit the impact of opening the point-in-time on the cluster
  • Added require_alias parameter (bool), when true, requires destination to be an alias.
  • Added grid_agg parameter (string), aggregation used to create a grid for field.
  • Compatibility with Elasticsearch 9.0: All changes and additions to Elasticsearch APIs for its 9.0 release are reflected in this release.
  • Serverless client merged in: the elastic/elasticsearch-serverless client is being deprecated, and its functionality has been merged back into this client. This should have zero impact on the way the client works by default. If an endpoint is available in serverless, the PHP function will contains a @group serverless phpdoc attribute. If you try to use an endpoint that is not available in serverless you will get a 410 HTTP error with a message as follows: "this endpoint exists but is not available when running in serverless mode". The 9.0.0 client can recognize that it is communicating with a serverless instance if you are using a URL managed by Elastic (e.g. *.elastic.cloud). If you are using a proxy, the client will be able to recognize that the host is serverless from the first response. Alternatively, you can explicitly indicate that the host is serverless using the Client::setServerless(true) function (false by default).
  • New transport library with PSR-18 cURL client as default: we've removed the Guzzle dependency from the client. By default, the built-in cURL-based HTTP client will be used if no other PSR-18 compatible clients are detected. See release 9.0.0 of elastic-transport-php.
  • Fixed PHPStan array shape: we fixed the array shape definition for all the endpoints, upgrading PHPStan to verion 2.1. See PR #1439