You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'verify' => false, // Disables SSL verification for local development.
34
51
]);
35
-
36
-
// OR via Builder
37
-
// $this->client = (new \OpenSearch\ClientBuilder())
38
-
// ->setHosts(['https://localhost:9200'])
39
-
// ->setBasicAuthentication('admin', 'admin') // For testing only. Don't store credentials in code.
40
-
// // or, if using AWS SigV4 authentication:
41
-
// ->setSigV4Region('us-east-2')
42
-
// ->setSigV4CredentialProvider(true)
43
-
// ->setSSLVerification(false) // For testing only. Use certificate for validation
44
-
// ->build();
45
52
}
46
53
47
54
@@ -359,7 +366,61 @@ try {
359
366
360
367
```
361
368
362
-
## ClientBuilder
369
+
## Client Factories
370
+
371
+
You can create an OpenSearch Client using any [PSR-18](https://www.php-fig.org/psr/psr-18/) compatible HTTP client. Two factories are provided to reduce the boilerplate code required to create a client using [Guzzle](https://docs.guzzlephp.org/en/stable/) or [Symfony](https://symfony.com/doc/current/http_client.html) HTTP clients.
372
+
373
+
The `GuzzleClientFactory` and `SymfonyClientFactory` classes are used to create an OpenSearch Client instance.
374
+
375
+
### Guzzle Client Factory
376
+
377
+
This factory creates an OpenSearch Client instance using the Guzzle HTTP client.
378
+
379
+
```bash
380
+
composer require guzzlehttp/guzzle
381
+
```
382
+
383
+
```php
384
+
$client = (new \OpenSearch\GuzzleClientFactory())->create([
0 commit comments