PHPackages                             directorytree/opensearch-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. directorytree/opensearch-client

ActiveLibrary[API Development](/categories/api)

directorytree/opensearch-client
===============================

A Laravel integration for the official OpenSearch PHP client

10PHPCI passing

Pushed todayCompare

[ Source](https://github.com/DirectoryTree/OpenSearchClient)[ Packagist](https://packagist.org/packages/directorytree/opensearch-client)[ RSS](/packages/directorytree-opensearch-client/feed)WikiDiscussions master Synced today

READMEChangelog (1)DependenciesVersionsUsed By (0)

OpenSearch Client
=================

[](#opensearch-client)

A Laravel integration for the official [OpenSearch PHP client](https://github.com/opensearch-project/opensearch-php).

Installation
------------

[](#installation)

Install the package with Composer:

```
composer require directorytree/opensearch-client
```

Configuration
-------------

[](#configuration)

Publish the configuration file:

```
php artisan vendor:publish --provider="DirectoryTree\OpenSearchClient\OpenSearchClientServiceProvider"
```

The published `config/opensearch-client.php` file defines the default connection and any named OpenSearch connections:

```
return [
    'default' => env('OPENSEARCH_CONNECTION', 'default'),

    'connections' => [
        'default' => [
            'base_uri' => env('OPENSEARCH_HOST', 'http://localhost:9200'),
        ],
    ],
];
```

Each connection is passed directly to `OpenSearch\GuzzleClientFactory`.

Usage
-----

[](#usage)

Resolve `DirectoryTree\OpenSearchClient\OpenSearchManager` from the container to access OpenSearch clients:

```
namespace App\Console\Commands;

use DirectoryTree\OpenSearchClient\OpenSearchManager;
use Illuminate\Console\Command;

class CreateIndex extends Command
{
    protected $signature = 'create:index {name}';

    protected $description = 'Creates an index';

    public function handle(OpenSearchManager $opensearch): void
    {
        $client = $opensearch->default();

        $client->indices()->create([
            'index' => $this->argument('name'),
        ]);
    }
}
```

You can also resolve named connections:

```
$client = $opensearch->connection('write');
```

You may also use the facade:

```
use DirectoryTree\OpenSearchClient\Facades\OpenSearch;

$client = OpenSearch::connection('write');
```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance65

Regular maintenance activity

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity8

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/c6dd082636ff8a08df8dfdcd622ea242374d1d76dd33bceec5a6cd3ae26dc24f?d=identicon)[stevebauman](/maintainers/stevebauman)

---

Top Contributors

[![stevebauman](https://avatars.githubusercontent.com/u/6421846?v=4)](https://github.com/stevebauman "stevebauman (3 commits)")

### Embed Badge

![Health badge](/badges/directorytree-opensearch-client/health.svg)

```
[![Health](https://phpackages.com/badges/directorytree-opensearch-client/health.svg)](https://phpackages.com/packages/directorytree-opensearch-client)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[botman/driver-telegram

Telegram driver for BotMan

93452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
