elastic/elasticsearch-php
64.4
Adequate · 17 November 2026
30k
lines of production code
PHP
primary language
5
measurements over time
What this system is
Features
Added dense vector bulk upload benchmark example
A new PHP script, \examples/dense\_vector\_benchmark.php\, has been added to demonstrate high-performance bulk indexing of dense vectors. The example benchmarks ingestion speeds by comparing standard float32 vectors against base64-packed vectors, allowing users to evaluate performance differences across various chunk sizes and repetition counts.
examples · high confidence
Added scroll-based search iterators for Elasticsearch
New iterator classes have been added to the Helper/Iterators namespace to support paginated search results via Elasticsearch's scroll API. SearchResponseIterator manages the lifecycle of scroll windows, handling the initial search request, fetching subsequent pages using the scroll ID, and automatically clearing the scroll context upon destruction. SearchHitIterator wraps the response iterator to flatten the paginated structure, allowing users to iterate directly over individual search hits across all pages while exposing the total hit count.
src/Helper/Iterators · high confidence
Elasticsearch PHP Client version 9.5.0 release
The Elasticsearch PHP client has been updated to version 9.5.0. This release introduces a new \ClientInterface\ to standardize client interactions, adds support for configuring the client for Elastic Serverless environments, and includes a new \Utility\ class for environment variable handling and variable name formatting. The \ClientBuilder\ has been updated to support these new configuration options, and the client now sends an API compatibility header (\compatible-with=9\) and an \elastic-api-version\ header (\2023-10-31\) with requests.
src · high confidence
Expanded ES\|QL query builder with new processing commands
The ES\|QL query builder in src/Helper/Esql has been refactored into a modular class structure and extended with support for additional ES\|QL processing commands. New capabilities include CHANGE\_POINT for detecting metric anomalies, COMPLETION for LLM text generation, DISSECT and GROK for log parsing, ENRICH for data enrichment, FORK for parallel query branches, FUSE for merging results, LOOKUP\_JOIN for external data joins, MMR for vector similarity search, REGISTERED\_DOMAIN for domain extraction, and RERANK for AI-driven result reordering. The builder now also supports the METRICS\_INFO and TS\_INFO commands for deployment and time-series metadata, alongside existing commands like EVAL, STATS, and SORT, allowing users to construct more complex and modern ES\|QL queries programmatically.
src/Helper/Esql · high confidence
Initial repository structure and configuration for elasticsearch-php
This change establishes the foundational structure for the elasticsearch-php client repository. It introduces the \AGENTS.md\ file to provide setup and development workflow instructions for AI coding agents, and \BREAKING\_CHANGES.md\ to document architectural shifts and API removals across major versions (notably the PHP 8.1+ requirement and PSR-18 transport changes in 9.0). The repository now includes a comprehensive \CHANGELOG.md\ tracking releases from 9.5.0 back to 6.0, and a \README.md\ detailing installation, usage, and compatibility. Configuration files for static analysis (\phpstan.neon\), testing (\phpunit.xml.dist\, \phpunit-integration-tests.xml\, and YAML test suites), and build infrastructure (\catalog-info.yaml\, \.gitattributes\, \.gitignore\) are added to standardize the development environment.
(repo-wide) · high confidence
Introduction of specific exception classes for the Elasticsearch PHP client
The library now provides a dedicated set of exception classes within the \Elastic\\Elasticsearch\\Exception\ namespace, all implementing the \ElasticsearchException\ interface. This includes specific types for HTTP errors (\ClientResponseException\ for 4xx, \ServerResponseException\ for 5xx), configuration issues (\ConfigException\), content type mismatches (\ContentTypeException\), and bulk helper operations (\BulkHelperException\, which includes response details via \ResponseTrait\). Other added exceptions cover array access, authentication, invalid arguments, missing parameters, and product checks, allowing for more precise error handling.
src/Exception · high confidence
New Buildkite CI pipeline for PHP client tests
Added a new Buildkite CI configuration that automates the testing of the PHP client against Elasticsearch. The setup includes a Dockerfile for the test environment, a pipeline definition that runs tests across PHP versions 8.1 through 8.5, and scripts to launch Elasticsearch nodes (supporting both free and platinum security configurations) and execute integration tests.
.buildkite · high confidence
New Elasticsearch response wrapper with multi-format deserialization
The \src/Response\ area now introduces the \Elasticsearch\ class and its \ElasticsearchInterface\, providing a dedicated wrapper around PSR-7 HTTP responses. This component enables users to easily deserialize response bodies into arrays, objects, or strings based on the Content-Type header (supporting JSON, NDJSON, CSV, and XML). It also includes logic to detect Serverless responses via the API version header and automatically throws specific client or server exceptions for 4xx and 5xx status codes when configured.
src/Response · high confidence
New HTTP client adapter system with SSL configuration support
The transport layer now supports pluggable HTTP client adapters (Guzzle, Symfony, and a new ElasticCurl implementation) via a unified interface, allowing users to configure SSL certificates, keys, verification, and CA bundles consistently across different underlying HTTP libraries.
src/Transport · high confidence
New bulk indexing helper and dense vector packing utility
Added a new Bulk helper class in src/Helper/Bulk.php that simplifies batch operations against Elasticsearch by accepting an iterator of actions, automatically chunking them by count (default 500) or size (default 10MB), and returning operation statistics and optional detailed results. The helper supports index, create, partial update, and delete actions via dedicated static methods. Additionally, a new Vectors helper in src/Helper/Vectors.php provides a packDenseVector method that encodes float arrays into a base64-encoded binary format for efficient vector uploads.
src/Helper · high confidence
Removals
Removal of legacy ElasticSearch exception classes and empty serializer
The \ElasticSearch\\Common\\Exceptions\ namespace has been cleaned up by removing the \BadMethodCallException\, \InvalidArgumentException\, \UnexpectedValueException\ classes and the \ElasticSearchException\ interface, which previously extended standard PHP exceptions. Additionally, the empty \JSONSerializer\ class in \ElasticSearch\\Serializers\ has been deleted. These changes remove unused or placeholder code from the library's common and serialization components.
src/ElasticSearch/Common, src/ElasticSearch/Serializers · high confidence
Removed legacy ElasticSearch Client and Transport classes
The legacy \Client\ and \Transport\ classes in the \src/ElasticSearch\ directory have been removed. This eliminates the previous implementation that relied on a Pimple-based dependency injection container for managing connection pools, selectors, and transport logic, effectively cleaning up the codebase by discarding these specific components.
src/ElasticSearch · high confidence
Removed placeholder ElasticSearch Connection class
The stub implementation of the \ElasticSearch\\Connections\\Connection\ class has been removed from the codebase. This class previously served only as a placeholder, printing constructor arguments without providing any functional connection logic, and its deletion cleans up unused code.
src/ElasticSearch/Connections · high confidence
Removed placeholder ElasticSearch connection pool and selector classes
The \src/ElasticSearch/ConnectionPool\ directory has been removed, deleting the \ConnectionPool\ class and all associated selector implementations (\SelectorInterface\, \RoundRobinSelector\, \BackupSelector\, \RandomSelector\). These files were empty stubs or incomplete placeholders that did not contain functional logic, effectively cleaning up unused infrastructure from the codebase.
src/ElasticSearch/ConnectionPool · high confidence
Behavioural changes
Generated Elasticsearch PHP client endpoints now include OpenTelemetry support
The API endpoint classes in src/Endpoints have been regenerated to include OpenTelemetry (OTel) instrumentation. Each endpoint method now calls addOtelAttributes to attach trace context to outgoing requests, enabling distributed tracing for client operations. This change is visible across all generated endpoint files (e.g., AsyncSearch, Autoscaling, Cat, Ccr, Cluster, Connector), which now consistently integrate OTel attributes into their HTTP request lifecycle.
src/Endpoints · high confidence
Updated API endpoints and traits for Elasticsearch 8.x compatibility
The \src/Traits\ directory has been regenerated to align with the latest Elasticsearch API specifications (versions 8.4 through 9.1). This update introduces new endpoint methods such as \bulk\, \clearScroll\, and \closePointInTime\ in \ClientEndpointsTrait\, while \EndpointTrait\ now handles parameter conversion (arrays to comma-separated lists, booleans to strings) and manages API compatibility headers for serverless environments. Additionally, \MessageResponseTrait\ has been updated to implement PSR-7 v2.0 interfaces, and \NamespaceTrait\ includes new namespace accessors for features like \AsyncSearch\, \Esql\, and \Streams\.
src/Traits · high confidence
Test coverage
Added comprehensive test suite for Elasticsearch PHP client; Added integration tests for Elasticsearch client features; Added tests for EndpointTrait request building and header handling; Added tests for the Elasticsearch response object; Added unit tests for SearchHitIterator and SearchResponseIterator; Added unit tests for the ES\|QL Query helper; Removed legacy PHPUnit tests for Client, ConnectionPool, and Transport.
Dependencies
131 commits updating dependencies (1 manifest)
A dependency / build maintenance change in (dependencies) — 131 commits (15 fixs), 1 file.
(dependencies) · medium confidence · unverified
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 51.0 → 64.4 (+13.4)
- Rubric changed (rubric-2026.11.2 → rubric-2026.11.4) — scores are not directly comparable.
Lenses
- Code Health 72.9 → 72.8 (-0.1)
- Architecture 64.8 → 73.3 (+8.5)
- Maturity 64.1 → 61.1 (-3.0)
- Readiness 50.1 → 63.8 (+13.7)
- Security 43.3 → 69.2 (+25.9)
Resolved (20)
- Fork-triggerable workflow runs with an unscoped write token (.github/workflows/backport.yml)
- High secret: WD-SECRET-0005 (examples/docs/src/Examples/Docs/X-pack/Docs/En/Rest-api/Security/CreateUsers.php)
- High secret: WD-SECRET-0005 (examples/docs/src/Examples/Docs/X-pack/Docs/En/Rest-api/Security/GetTokens.php)
- High secret: WD-SECRET-0005 (examples/docs/src/Examples/Docs/X-pack/Docs/En/Rest-api/Security/InvalidateTokens.php)
- Leaked secret: private-key (.buildkite/certs/testnode.key)
- Leaked secret: private-key (.buildkite/certs/testnode_san.key)
- No SBOM
- No artifact signing
- No build provenance
- Off-boarding risk: anonymized user #1
- Projects may be oversized for their cohesion
- Secret: generic-api-key (examples/docs/src/Examples/Docs/X-pack/Docs/En/Rest-api/Security/GetTokens.php)
- Secret: generic-api-key (examples/docs/src/Examples/Docs/X-pack/Docs/En/Rest-api/Security/InvalidateTokens.php)
- Secret: generic-api-key (examples/docs/src/Examples/Docs/X-pack/Docs/En/Rest-api/Security/OidcLogoutApi.php)
- Secret: private-key (.buildkite/certs/testnode.key)
- Secret: private-key (.buildkite/certs/testnode_san.key)
- Secret: private-key (.ci/certs/testnode.key)
- Secret: private-key (.ci/certs/testnode_san.key)
- Secret: private-key (travis/certs/testnode.key)
- Unpinned build actions
New (14)
- Circular dependency (src/ClientBuilder.php)
- Edited copies of one member (3 members, 18+ corresponding lines) (src/Transport/Adapter/ElasticCurl.php)
- Edited copy of a member (10 corresponding lines) (src/Helper/Esql/CompletionCommand.php)
- Edited copy of a member (22 corresponding lines) (src/Response/Elasticsearch.php)
- Off the main sequence: src/Exception
- Off-boarding risk: anonymized user #1
- Orphaned file (src/Client.php)
- Orphaned file (src/ClientBuilder.php)
- Orphaned file (src/Helper/Bulk.php)
- Orphaned file (src/Helper/Esql/ChangePointCommand.php)
- Orphaned file (src/Helper/Esql/CompletionCommand.php)
- Orphaned file (src/Helper/Esql/EnrichCommand.php)
- Orphaned file (src/Helper/Esql/RerankCommand.php)
- Orphaned file (src/Helper/Esql/StatsCommand.php)
Changes since last survey
- 4 commits — 3 feature/other, 1 fixes
By area
- (repo) — 3 commits
- src/Endpoints — 1 commit
Notable commits
- fix: Merge pull request #1599 from elastic/fix/explicit-github-token-permissions
- change: Auto-generated API code
- change: Merge pull request #1628 from elastic/generates_main_code
- change: Merge pull request #1636 from elastic/bump_stack_9.7.0-SNAPSHOT
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
elastic/elasticsearch-php was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 17 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit a391a3efe0a63d8eb65cae573990da8dc5902361 — the exact code this score is about.
- Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.85+preprod-eba6548ac50f.