Download the PHP package wonsulting/opensearch-client without Composer
On this page you can find all versions of the php package wonsulting/opensearch-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wonsulting/opensearch-client
More information about wonsulting/opensearch-client
Files in wonsulting/opensearch-client
Package opensearch-client
Short Description The official PHP OpenSearch client integrated with Laravel
License MIT
Informations about the package opensearch-client
OpenSearch Client
The official PHP OpenSearch client integrated with Laravel.
Contents
- Compatibility
- Installation
- Configuration
- Usage
- Documentation
Compatibility
| Requirement | Supported versions |
|---|---|
| PHP | 8.2 – 8.4 |
| Laravel | 11 – 13 |
| OpenSearch (opensearch-php client) | 2.x |
Laravel 13 requires PHP 8.3 or newer.
Installation
The library can be installed via Composer:
Configuration
To change the client settings you need to publish the configuration file first:
In the newly created config/opensearch.client.php file you can define the default connection name and one options array per connection.
Each connection is the options array for the SDK's PSR-18 OpenSearch\GuzzleClientFactory. base_uri is required
(a single URI with an explicit scheme); auth, verify, and any other Guzzle request option pass straight through.
retries is the one package-level key — it is applied as the factory's maxRetries, not sent to Guzzle.
Migrating from v2.x: the per-connection
hostsarray was replaced by a singlebase_uri, andOPENSEARCH_HOSTbecameOPENSEARCH_BASE_URI. A connection that still contains ahostskey throwsInvalidConfigurationExceptionrather than silently dropping hosts — the new API expresses exactly one host per connection.
To swap the HTTP client (e.g. Symfony), add AWS SigV4 signing, or attach a logger, bind your own
OpenSearch\ClientFactoryInterface in the container and ClientBuilder will use it instead of the default
GuzzleClientFactory:
If you need still more control over the client creation, you can create your own client builder:
Do not forget to register the builder in your application service provider:
Usage
Use OpenSearch\Laravel\Client\ClientBuilderInterface to get access to the client instance:
Documentation
Maintainer-facing docs live in docs/:
- Architecture — package internals, the three classes, DI flow, config schema, and caching semantics.
- Runbook — setup, tests, quality tooling, CI mapping, smoke test, and release process.